#46587 [SC-Low] Overpayment loss in `transferToCoreVault` due to incorrect refund condition
Description
Vulnerability Details
// pay the transfer fee and return overpaid transfer fee when the difference is larger than gas use
// (all transfers are guarded by nonReentrant in the facet)
if (msg.value > transferFeeWei + Transfers.TRANSFER_GAS_ALLOWANCE) {
Transfers.transferNAT(state.nativeAddress, transferFeeWei);
Transfers.transferNATAllowFailure(payable(msg.sender), msg.value - transferFeeWei);
} else {
Transfers.transferNAT(state.nativeAddress, msg.value);
}Example Scenario
Case – Small Overpayment
Impact
Recommended Mitigations
Proof of Concept
Proof-of-Concept
Steps
Previous#46546 [SC-Insight] Accounting Mismatches in AgentVault.sol Due to Non-Standard ERC20 TokensNext#46592 [SC-High] The return value of redeemFromAgent/redeemFromAgentInCollateral in the selfCloseExitTo is not checked
Was this helpful?