Not checking call success in TRANSFER_NATIVE
The smart contract's native transfer function does not check whether the low-level call to send Ether succeeded. An attacker could cause a transfer to fail silently, leaving the user unaware that the funds were not sent.
- Disclosed after under an hour
#43408 [SC-Low] Not checking call success in `TRANSFER_NATIVE`
Submitted on Apr 5th 2025 at 16:53:29 UTC by @PotEater for Audit Comp | Spectra Finance
- Report ID: #43408
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/Spectra-Audit-Competition/blob/main/src/router/Dispatcher.sol
- Impacts:
Description
Brief/Intro
In the function _dispatch you are making a call to another address with ether, but there is no check whether the call was successful or not. This could lead to user frustration and inefficiencies.
Vulnerability Details
The call function is a low-level operation in Solidity that is used to send Ether to an address. It returns a boolean value, success, indicating whether the call was successful or not. However, in this case, the success value is not being checked or handled.
(bool success, ) = payable(recipient).call{value: amount}("");
// no check if call succeeded or not.
Impact Details
Without error handling for the call failure, users may assume their transaction was successful, leading to confusion and frustration when they don’t see the expected results. This could erode trust in the contract and result in users abandoning the platform.
This is a security best practice.
References
Proof of Concept
Proof of Concept
else if (command == Commands.TRANSFER_NATIVE) {
(address recipient, uint256 amount) = abi.decode(_inputs, (address, uint256));
(bool success, ) = payable(recipient).call{value: amount}("");
// forgot to check if the call was successful or not
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 contract fails to check the boolean success value returned by the low-level call used to transfer native currency.
Impact
Users may believe their transaction succeeded when the Ether transfer actually failed, leading to confusion and loss of trust; no direct loss of funds is claimed.
What the attacker needed
None
The fix
The contract should check the success boolean and revert if the call fails.
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 to another address, it uses a low-level call that returns a true or false value indicating success. This contract ignores that value, so if the transfer fails, the transaction still completes without any error. A user might think their funds were sent when they were not.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.