Skip to content
Business logic Audit finding Beginner

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.

Rhaydden Follow

Originally disclosed on Immunefi

Informational View original
  • 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

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:

Solidity
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:

Solidity
teller.depositAndBridge(...);
_calcSharesAndEmitEvent(...);

During a bridge:

  • msg.sender is the EOA that calls the wrapper.
  • teller.depositAndBridge mints shares to the wrapper, immediately burns them, and bridges the same amount to bridgeData.destinationChainReceiver.
  • The emitted Deposit event thus claims that msg.sender received shares, 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

https://github.com/immunefi-team/attackathon-plume-network-nucleus-boring-vault/blob/0ee676b5715075c26db6706960fd49ab59b587fc/src/helper/DexAggregatorWrapperWithPredicateProxy.sol#L407

Proof of Concept

{% stepper %} {% step %}

Step: Setup / Deploy

  1. Deploy the relevant contracts.
  2. Choose two EOAs:
    • Alice (caller)
    • Bob (destinationChainReceiver) {% endstep %}

{% step %}

Step: Execute and Observe

  1. Alice calls depositAndBridgeOneInch with bridgeData.destinationChainReceiver = Bob.
  2. Observe the Deposit event on the source chain: it reports receiver = Alice.
  3. 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 %}

The original report as published on Immunefi, by Rhaydden. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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

  1. Deploy the relevant contracts and choose two externally owned accounts: Alice as caller and Bob as destinationChainReceiver.
  2. Alice calls depositAndBridgeOneInch with bridgeData.destinationChainReceiver set to Bob.
  3. Observe the Deposit event on the source chain reports receiver as Alice.
  4. 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.

More by Rhaydden

View all

36 more disclosed reports, best first.

More from Plume Network

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.