F-2026-0010·missing-refund

No refund of excess msg.value in native BNB operations leads to permanent absorption of overpaid funds

Fixedbridgecross-chainkey-registrygithub.com/pdxwebdev/yadakeyeventwallet
TL;DR

_handleWrap uses msg.value >= recipient.amount with no refund mechanism, so any overpayment is permanently absorbed into the bridge's balance and only recoverable via emergencyWithdrawBNB which also drains user collateral.

Severity
LOW
Impact
LOW
Likelihood
MEDIUM
Method
MManual review
CAT.
Complexity
LOW
Exploitability
LOW
02Section · Description

Description

In _handleWrap for native BNB operations, the balance check uses >= rather than ==:

solidity
require(
msg.value >= recipient.amount,
"Insufficient native token sent"
);

If msg.value exceeds the total BNB needed for the operation, the excess remains in the bridge's balance permanently. There is no refund mechanism anywhere in the transaction flow. The totalTransferred != permit.amount check at line 342 validates permit accounting but does not enforce that msg.value matches the required amount.

The only way to extract BNB from the bridge is emergencyWithdrawBNB, which sweeps the entire native balance, including collateral backing wrapped native tokens. It cannot selectively refund excess BNB without also removing collateral.

03Section · Recommendation

Recommendation

Either enforce an exact match or refund excess BNB at the end of the transaction:

solidity
// Option 1: Enforce exact amount
require(
msg.value == recipient.amount,
"Incorrect native token amount"
);
// Option 2: Refund excess after operations
uint256 excess = msg.value - totalRequired;
if (excess > 0) {
_transferNative(msg.sender, excess);
}
04Section · Resolution

Resolution

YadaCoin, Confirmed.

Zealynx, Fixed.

Status
Fixed
F-2026-0010

oog
zealynx

Smart Contract Security Digest

Monthly exploit breakdowns, audit checklists, and DeFi security research — straight to your inbox

© 2026 Zealynx