Lack of ETH transfer check leads to stolen funds
The Dispatcher contract's native-token transfer command ignores the boolean result of a low-level call, so a failed ETH transfer does not revert the transaction and the funds stay in the contract. An attacker can then call the same command to move those stranded funds to their own address.
- Disclosed after under an hour
#44091 [SC-Low] Lack of ETH transfer check leads to stolen funds
Submitted on Apr 16th 2025 at 20:12:20 UTC by @din for Audit Comp | Spectra Finance
- Report ID: #44091
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/Spectra-Audit-Competition/blob/main/src/router/Dispatcher.sol
- Impacts:
- Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Brief/Intro
Dispatcher.sol does not check if the low lvl call for sending ETH is successfull. If the call fails, the tx does not revert and the users funds remain stuck in the contract, without any way for the user to know that his funds did not reach the destination address. A malicious user can steal those stuck funds immedeately.
Vulnerability Details
The TRANSFER_NATIVE command does not check if the low lvl call is successfull.
else if (command == Commands.TRANSFER_NATIVE) {
(address recipient, uint256 amount) = abi.decode(_inputs, (address, uint256));
(bool success, ) = payable(recipient).call{value: amount}(""); <@
}
As a result, all failed calls will NOT cause the execute() call to revert. ETH sent from the user will be stuck in the Router/Dispatcher contracts
Impact Details
Stolen user funds from their failed ETH transfers. An attacker can call execute and transfer their ETH to his address
References
Proof of Concept
Proof of Concept
- A honest user calls Dispatcher::execute() with command: TRANSFER_NATIVE and sends 10 eth to a recepient contract
- The recepient contract fallback() reverts due to logic which freezes any transfers to it due to custom conditions met. For example: Admin has paused any transfers between 10pm-12pm . Or the recipient is a malicious contract that reverts when the fallback() is called.
- The honest user Dispatcher::execute() tx is successful, however his funds remain stuck in the contract, without him knowing it.
- A malicious user immediately calls Dispatcher::execute() TRANSFER_NATIVE and sends the stuck funds to his address.
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 return value of the low-level call used to send native tokens is ignored, so a failed transfer does not revert the transaction.
Impact
User funds from failed native transfers could be stolen by an attacker who sweeps the stranded balance.
What the attacker needed
Victim sends ETH to a reverting recipient; attacker can call execute
How it was found
- An honest user calls execute with the native transfer command, sending ETH to a recipient contract.
- The recipient's fallback reverts, for example because it is paused or is a malicious contract.
- The user's transaction still succeeds but the funds remain stuck in the contract.
- A malicious user calls execute with the native transfer command to send the stuck funds to their own address.
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 contract sends Ether to another address, the receiving address can refuse the payment. A safe contract checks whether the payment worked and cancels the whole transaction if it did not. Here that check is missing, so the money is left sitting in the contract where anyone can take it.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.