Skip to content
DoS Audit finding Intermediate

call() should be used instead of transfer() on an address payable

The smart contracts use the deprecated transfer() function to send Ether, which forwards only 2300 gas. If the recipient is a contract that needs more gas (e.g., a multisig wallet or a proxy), the transfer will fail, potentially locking funds or breaking functionality.

Dravee Follow

Originally disclosed on Code4rena

Submitted by Dravee, also found by antonttc, berndartmueller, cccz, danb, horsefacts, hyh, IllIllI, MaratCerby, pauliax, rayn, UnusualTurtle, WatchPug, and wuwe1

This is a classic Code4rena issue:

Impact

The use of the deprecated transfer() function for an address will inevitably make the transaction fail when:

  1. The claimer smart contract does not implement a payable function.
  2. The claimer smart contract does implement a payable fallback which uses more than 2300 gas unit.
  3. The claimer smart contract implements a payable fallback function that needs less than 2300 gas units but is called through proxy, raising the call’s gas usage above 2300.

Additionally, using higher than 2300 gas might be mandatory for some multisig wallets.

Impacted lines:

backd/contracts/pool/EthPool.sol:
  30:         to.transfer(amount);

backd/contracts/strategies/BkdEthCvx.sol:
   77:             payable(vault).transfer(amount);
   93:         payable(vault).transfer(amount);
  117:         payable(vault).transfer(underlyingBalance);

backd/contracts/vault/EthVault.sol:
  29:         payable(to).transfer(amount);
  37:         payable(addressProvider.getTreasury()).transfer(amount);

backd/contracts/vault/VaultReserve.sol:
  81:             payable(msg.sender).transfer(amount);

Recommended Mitigation

I recommend using call() instead of transfer().

chase-manning (Backd) confirmed and resolved

gzeon (judge) commented:

Sponsor confirmed. Judging this as Medium Risk.


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

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 use of the deprecated transfer() method, which forwards a fixed 2300 gas stipend, instead of call() which allows specifying gas.

Impact

Transactions sending Ether could fail if the recipient contract requires more than 2300 gas, potentially causing loss of funds or denial of service.

What the attacker needed

Recipient is a contract needing >2300 gas; or recipient is a proxy; or recipient is a multisig wallet

The fix

The fix is to replace transfer() with call() and handle the return value, as the sponsor confirmed and resolved.

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 Ether using transfer(), it only gives the recipient a tiny fixed amount of gas (2300). If the recipient is another contract that needs to do more work (like a multisig wallet), the transfer fails. This report says the code should use call() instead, which lets the recipient use more gas.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by Dravee

View all

9 more disclosed reports, best first.

More from Backd Tokenomics contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.