Skip to content
Race condition Audit finding Advanced

Re entrant eth refund can emit mismatched shares in deposit event

The proxy contract computes the share amount for its Deposit event after an external call that can refund surplus ETH, and the refund path forwards ETH to a caller-controlled address that can re-enter and change the rate. An attacker could therefore make the emitted Deposit event report a share value that differs from what was actually minted.

Paludo0x Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

50675 sc insight re entrant eth refund can emit mismatched shares in deposit event

Submitted on Jul 27th 2025 at 12:11:56 UTC by @Paludo0x for Attackathon | Plume Network

Description

Vulnerability Details

TellerWithMultiAssetSupportPredicateProxy::depositAndBridge() calculates the number of shares to log after calling teller.depositAndBridge().

During that external call the Teller may refund surplus ETH to the proxy; the proxy’s receive() immediately forwards that ETH to lastSender with a raw call. This opens a re-entrancy window before the share amount is computed for the Deposit event.

A malicious user could manipulate the rate inside that window, causing the event to report a share value different from the amount actually minted.

Impact Details

Severity is set to Low because there is no direct fund loss.

However, because this is an RWA protocol, many off-chain services may rely on emitted events. There's a secondary risk of mis-accounting, compliance violations, and potential business/legal exposure if RWA reporting relies solely on events.

Recommended fix

{% stepper %} {% step %} Compute the shares value before the external call. {% endstep %}

{% step %} Have Teller:depositAndBridge() return the minted shares value, and use that returned value for the event emission. {% endstep %} {% endstepper %}

Proof of Concept

<details> <summary>Relevant proxy code and explanation (expand)</summary>

This is TellerWithMultiAssetSupportPredicateProxy::depositAndBridge() relevant code:

{% code title="TellerWithMultiAssetSupportPredicateProxy::depositAndBridge()" %}

{% endcode %}

Solidity
function depositAndBridge(
    ERC20 depositAsset,
    uint256 depositAmount,
    uint256 minimumMint,
    BridgeData calldata data,
    CrossChainTellerBase teller,
    PredicateMessage calldata predicateMessage
)
    external
    payable
    nonReentrant
{
...
    // mint shares
    teller.depositAndBridge{ value: msg.value }(depositAsset, depositAmount, minimumMint, data);
    lastSender = address(0);
    uint96 nonce = teller.depositNonce();
    //get the current share lock period
    uint64 currentShareLockPeriod = teller.shareLockPeriod();
    AccountantWithRateProviders accountant = AccountantWithRateProviders(teller.accountant());
    //get the share amount
    uint256 shares = depositAmount.mulDivDown(10 ** vault.decimals(), accountant.getRateInQuoteSafe(depositAsset));

    emit Deposit(
        address(teller),
        data.destinationChainReceiver,
        address(depositAsset),
        depositAmount,
        shares,
        block.timestamp,
        currentShareLockPeriod,
        nonce > 0 ? nonce - 1 : 0,
        address(vault)
    );
}

When calling teller.depositAndBridge{ value: msg.value }(...) the native tokens are sent to the teller, which will bridge the message and pass msg.value to the bridging function.

Excerpt from MultiChainLayerZeroTellerWithMultiAssetSupport:

{% code title="MultiChainLayerZeroTellerWithMultiAssetSupport::_bridge" %}

{% endcode %}

Solidity
function _bridge(uint256 shareAmount, BridgeData calldata data) internal override returns (bytes32) {

...
    MessagingReceipt memory receipt = _lzSend(
        data.chainSelector,
        _payload,
        _options,
        // Fee in native gas and ZRO token.
        MessagingFee(msg.value, 0),
        // Refund address in case of failed source message.
        payable(msg.sender)
    );

    return receipt.guid;
}

LayerZero (and other bridges) can return excess native tokens to the sender. In this case the proxy's receive() forwards ETH immediately to lastSender:

{% code title="TellerWithMultiAssetSupportPredicateProxy::receive" %}

{% endcode %}

```solidity receive() external payable { // If we have a lastSender and receive ETH, forward it if (lastSender != address(0) && msg.value > 0) { // Forward the ETH to the last sender (bool success,) = lastSender.call{ value: msg.value }(""); if (!success) revert TellerWithMultiAssetSupportPredicateProxy__ETHTransferFailed(); } } ```

If lastSender is a smart contract, its receive() can re-enter and manipulate state (e.g., change a rate provider or another component) before the proxy calculates shares and emits the Deposit event, causing the event to contain an incorrect shares value.

    function depositAndBridge(...)
        external
        payable
        nonReentrant
    {
...
receive() IS TRIGGERED INSIDE THIS CALL:
        teller.depositAndBridge{ value: msg.value }(depositAsset, depositAmount, minimumMint, data);

HERE STARTS  THE CALCULATION OF VALUES TO BE EMITTED
        lastSender = address(0);
        uint96 nonce = teller.depositNonce();
        //get the current share lock period
        uint64 currentShareLockPeriod = teller.shareLockPeriod();
        AccountantWithRateProviders accountant = AccountantWithRateProviders(teller.accountant());
        //get the share amount
        uint256 shares = depositAmount.mulDivDown(10 ** vault.decimals(), accountant.getRateInQuoteSafe(depositAsset));

        emit Deposit(...);
    }
</details>

Notes

  • All links and code snippets are preserved as in the original report.
  • No additional assertions or claims are added beyond the original content.

The original report as published on Immunefi, by Paludo0x. 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

Likely the share amount for the Deposit event is calculated after an external call that can trigger a re-entrant ETH refund, instead of being taken from the value actually minted.

Impact

There is no direct fund loss, but off-chain services relying on the event could mis-account, with possible compliance and business exposure for an RWA protocol.

What the attacker needed

Attacker controls lastSender contract; deposit triggers an ETH refund

The fix

The shares value should be computed before the external call, or depositAndBridge should return the minted shares and that returned value should be used for the event.

How it was found

  1. Call depositAndBridge with ETH so the teller bridges and may refund surplus ETH to the proxy.
  2. The proxy's receive() forwards the refunded ETH to lastSender, which can be an attacker contract.
  3. The attacker's receive() re-enters and changes the rate used by the accountant.
  4. The proxy then computes shares from the changed rate and emits a Deposit event with a mismatched value.

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 into a vault, the contract records how many 'shares' you got in an event, which is like a public receipt. This contract works out that share number after it has already sent some money back to the depositor, and the depositor's contract can run code at that moment to change the exchange rate. The receipt then shows a wrong number, which could confuse systems that trust the receipt.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

More by Paludo0x

View all

42 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.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.