Skip to content
Smart contracts Audit finding Beginner

Permissions - return values not checked when sending ETH

The contract transfers ETH using a low-level call but does not check whether the call succeeded, so a withdrawal can appear successful while the ETH was not actually sent. An attacker could exploit this by providing a destination that rejects ETH or an amount larger than the balance, causing the transaction to fail silently.

ScopeLift Follow

Originally disclosed on Code4rena

Submitted by ScopeLift, also found by nathaniel

On lines 85 and 101, ETH is transferred using a .call to an address provided as an input, but there is no verification that the call call succeeded. This can result in a call to emergencyWithdrawGAS or partialWithdrawGAS appearing successful but in reality it failed. This can happen when the provided destination address is a contract that cannot receive ETH, or if the amount provided is larger than the contract’s balance

Proof of Concept

Enter the following in remix, deploy the Receiver contract, and send 1 ETH when deploying the Permissions contract. Call emergencyWithdrawGAS with the receiver address and you’ll see it reverts. This would not be caught in the current code

pragma solidity ^0.8.0;

contract Receivier{}

contract Permissions {
  constructor() payable {}

  function emergencyWithdrawGAS(address payable destination) external {
    (bool ok, ) = destination.call{value: address(this).balance}('');
    require(ok, "call failed");
  }
}

Tools Used

Remix

Recommended Mitigation Steps

In emergencyWithdrawGAS:

- destination.call{value: address(this).balance}('');
+ (bool ok, ) = destination.call{value: address(this).balance}('');
+ require(ok, "call failed");

And similar for partialWithdrawGAS

0xScotch (sponsor) confirmed

Alex the Entreprenerd (judge) commented:

Agree with the finding, I believe if a developer were to not use safeTransfer we’d rate as medium, so while I believe the impact to be minimal (no composability), I’ll keep the severity to medium

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

The contract uses a low-level call to transfer ETH but does not check the boolean success value returned by the call.

Impact

A withdrawal could appear successful while the ETH transfer actually failed, potentially leaving funds stuck or causing incorrect contract state; the judge rated the impact as minimal but kept severity at medium.

What the attacker needed

Contract holds ETH; destination rejects ETH or amount exceeds balance

The fix

The fix is to capture the boolean return value of the call and require it to be true, reverting if the call fails.

How it was found

  1. Deploy the Receiver contract in Remix.
  2. Deploy the Permissions contract with 1 ETH.
  3. Call emergencyWithdrawGAS with the receiver address.
  4. Observe that the call reverts, which would not be caught in the current code.

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 (the cryptocurrency used on Ethereum), it uses a low-level call that returns a true or false value indicating success. If the contract ignores that return value, it might think the transfer worked even when it did not, for example because the recipient is a contract that refuses to accept Ether. This means funds could be stuck or the contract's state could be wrong.

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 ScopeLift

View all

1 more disclosed report, best first.

More from Malt Protocol - Versus contest

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.