Incorrect deposit event receiver logged in bridge functions of dexaggregatorwrapperwithpredicateproxy sol
The bridge helper functions emit a Deposit event that records the caller as the share receiver, but the shares are actually bridged to a different destination address. Off-chain systems relying on this event could attribute shares to the wrong address.
- Disclosed after under an hour
50461 sc insight incorrect deposit event receiver logged in bridge functions of dexaggregatorwrapperwithpredicateproxy sol
Submitted on Jul 25th 2025 at 03:35:14 UTC by @Rhaydden for Attackathon | Plume Network
- Report ID: #50461
- Report Type: Smart Contract
- Report severity: Insight
- Target: https://github.com/immunefi-team/attackathon-plume-network-nucleus-boring-vault/blob/main/src/helper/DexAggregatorWrapperWithPredicateProxy.sol
- Impacts: Any off-chain system that attributes shares to addresses based on the emitted
Depositevent may incorrectly attribute shares to the wrong address.
Description
Brief / Intro
The two bridge helper functions depositAndBridgeOneInch() and depositAndBridgeOkxUniversal() emit a Deposit event that uses msg.sender as the share receiver. In practice, shares are burned locally and recreated for bridgeData.destinationChainReceiver on the destination chain, so the event’s receiver field is incorrect.
Vulnerability Details
Relevant code:
function _calcSharesAndEmitEvent(
ERC20 supportedAsset,
CrossChainTellerBase teller,
address fromToken,
uint256 fromTokenAmount,
uint256 supportedAssetAmount
) internal {
...
uint256 shares = supportedAssetAmount.mulDivDown(
10 ** teller.vault().decimals(),
AccountantWithRateProviders(teller.accountant()).getRateInQuoteSafe(supportedAsset)
);
emit Deposit(
fromToken, // depositAsset
msg.sender, // ← incorrect when bridging
address(supportedAsset),
fromTokenAmount,
supportedAssetAmount,
shares,
address(teller),
address(teller.vault())
);
}
Both bridge wrappers call this helper after performing the bridge:
teller.depositAndBridge(...);
_calcSharesAndEmitEvent(...);
During a bridge:
msg.senderis the EOA that calls the wrapper.teller.depositAndBridgemints shares to the wrapper, immediately burns them, and bridges the same amount tobridgeData.destinationChainReceiver.- The emitted
Depositevent thus claims thatmsg.senderreceivedshares, which never happens.
Impact Details
Off-chain systems that rely on this event to determine who received shares will attribute them to the caller (msg.sender) instead of the actual recipient (bridgeData.destinationChainReceiver).
Fix
Pass the real receiver into _calcSharesAndEmitEvent so the Deposit event correctly records the true destination receiver.
References
Proof of Concept
{% stepper %} {% step %}
Step: Setup / Deploy
- Deploy the relevant contracts.
- Choose two EOAs:
- Alice (caller)
- Bob (destinationChainReceiver) {% endstep %}
{% step %}
Step: Execute and Observe
- Alice calls
depositAndBridgeOneInchwithbridgeData.destinationChainReceiver = Bob. - Observe the
Depositevent on the source chain: it reportsreceiver = Alice. - After the bridge finalizes, Bob holds the bridged shares on the destination chain, while Alice never held them — demonstrating the event reports the wrong receiver. {% endstep %} {% endstepper %}
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The helper function `_calcSharesAndEmitEvent` always uses `msg.sender` as the receiver in the Deposit event, even when the shares are bridged to `bridgeData.destinationChainReceiver`.
Impact
Off-chain systems that rely on the Deposit event to determine who received shares could attribute them to the caller instead of the actual recipient.
What the attacker needed
None
The fix
Pass the real receiver into `_calcSharesAndEmitEvent` so the Deposit event correctly records the true destination receiver.
How it was found
- Deploy the relevant contracts and choose two externally owned accounts: Alice as caller and Bob as destinationChainReceiver.
- Alice calls depositAndBridgeOneInch with bridgeData.destinationChainReceiver set to Bob.
- Observe the Deposit event on the source chain reports receiver as Alice.
- After the bridge finalizes, Bob holds the bridged shares on the destination chain while Alice never held them.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you deposit money through a bridge, the system sends a message saying who got the shares. This message used the address of the person who started the transaction, not the address that actually received the shares on the other chain. Anyone reading that message would think the wrong person owns the shares.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.