Skip to content
Smart contracts Audit finding Intermediate

Silent Transfer Failures in Native Token Handling

The Zapper contract sends native tokens using the deprecated transfer method, which forwards only 2300 gas and does not check success. A receiver contract with a gas-heavy receive function can cause the transfer to fail silently while the transaction still completes, so users may believe funds were sent when they were not.

ZeroXGondar Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#41699 [SC-Insight] Silent Transfer Failures in Native Token Handling

Submitted on Mar 17th 2025 at 16:38:27 UTC by @ZeroXGondar for Audit Comp | Yeet

Description

Summary

In Zapper::_sendNativeToken when transferring native tokens, the contract uses unsafe transfer method instead of the recommended low level call method.

This is problematic since transfer method only passes 2300 gas, which can cause the transaction to be reverted if the interacting contract uses more gas in its receive/fallback function.

Details

The _sendNativeToken() function uses the deprecated transfer() method to send native BERA tokens. This approach has multiple security flaws:

  • No verification of transfer success
  • Silent failures possible when transfers fail
  • Limited to 2300 gas, insufficient for contracts with complex receive/fallback functions

Note that this function can be accessed in many flows, making the issue more serious. It can be accessed by directly calling Zapper::zapOutNative function, or, in more complex scenarios, it can be accessed via StakeV2::claimRewardsInNative function which in turn calls Zapper::zapOutNative that calls _sendNativeToken

Impact

  • Users may believe their funds were successfully transferred when they weren't
  • Protocol accounting may become inconsistent with actual token balances
  • Lack of error handling prevents recovery mechanisms from being triggered
  • Potential permanent loss of funds due to silent failures

Faulty block

Solidity
function _sendNativeToken(address receiver, uint256 amount) internal {
    if (amount > 0) {
        wbera.withdraw(amount);
        payable(receiver).transfer(amount);
    }
}

Recommended Fix

Replace transfer() with call() and add success verification:

Solidity
function _sendNativeToken(address receiver, uint256 amount) internal {
    if (amount > 0) {
        wbera.withdraw(amount);
        (bool success, ) = payable(receiver).call{value: amount}("");
        require(success, "Native token transfer failed");
    }
}

Proof of Concept

POC

  1. A contract with a gas-intensive receive function (consuming >2300 gas) is deployed on the network.
  2. The vulnerable flow is triggered in one of two ways:
    • Direct call to Zapper::zapOutNative with the gas-intensive contract as the receiver
    • Indirect call through StakeV2::claimRewardsInNative which ultimately calls _sendNativeToken
  3. When _sendNativeToken executes:
    • It successfully withdraws tokens from wbera with wbera.withdraw(amount)
    • It attempts to transfer native tokens using payable(receiver).transfer(amount)
    • The transfer silently fails because the receiver's receive function exceeds the 2300 gas limit
    • No error is thrown or checked since the contract doesn't verify the transfer's success
  4. The transaction completes without reverting, making it appear successful to users and the protocol.

The original report as published on Immunefi, by ZeroXGondar. 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 contract uses the deprecated transfer method, which forwards only 2300 gas and whose success is not verified, instead of a low-level call with an explicit success check.

Impact

Users may believe funds were transferred when they were not, protocol accounting may become inconsistent, and funds could be permanently lost due to silent failures.

What the attacker needed

Receiver is a contract with gas-heavy receive; attacker or user can trigger zapOutNative or…

The fix

Replace transfer with a low-level call and require that the call succeeds.

How it was found

  1. Deploy a contract whose receive function consumes more than 2300 gas.
  2. Trigger the vulnerable flow by calling zapOutNative directly with that contract as receiver, or indirectly through claimRewardsInNative.
  3. The function withdraws from wbera and then attempts to send native tokens with transfer.
  4. The transfer fails silently because the receiver exceeds the gas limit, and the transaction completes without reverting.

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 a smart contract sends cryptocurrency to another address, it can use different methods. The old transfer method gives the receiving code only a tiny amount of processing power (gas), so if the receiver needs more, the payment fails. Because the code never checks whether the payment worked, the transaction can look successful even though the money never arrived.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by ZeroXGondar

View all

1 more disclosed report, best first.

More from Yeet

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.