Users ETH could be stuck forever without a way to recover it
The Dispatcher contract's native token transfer command ignores the return value of the low-level call, so a failed transfer leaves the ETH stuck in the contract. An attacker or an incompatible recipient could cause the transfer to fail, permanently freezing the user's funds.
Originally disclosed on Immunefi
- Disclosed after under an hour
#44081 [SC-Low] Users ETH could be stuck forever without a way to recover it
Submitted on Apr 16th 2025 at 18:42:01 UTC by @MrMorningstar for Audit Comp | Spectra Finance
- Report ID: #44081
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/immunefi-team/Spectra-Audit-Competition/blob/main/src/router/Dispatcher.sol
- Impacts:
- Permanent freezing of funds
Description
Brief/Intro
Whenever native token is transfered from the contract it is done throught execute which eventually invoke _dispatch function. For the purpose of this finding we would focus on this part of the function:
} else if (command == Commands.TRANSFER_NATIVE) {
(address recipient, uint256 amount) = abi.decode(_inputs, (address, uint256));
(bool success, ) = payable(recipient).call{value: amount}("");
}
Vulnerability Details
The issue here is that the protocol does not check if the call was successful or not, which could lead that protocol funds be stuck to the contract forever.
Check PoC section for very common scenario.
Impact Details
The mentioned scenario is very common and likelihood it to happen is High which will lead the funds to be permanently stuck/froze forever.
Recommendation
Make sure the protocol check if call is successful:
else if (command == Commands.TRANSFER_NATIVE) {
(address recipient, uint256 amount) = abi.decode(_inputs, (address, uint256));
(bool success, ) = payable(recipient).call{value: amount}("");
+ require(success, "Native transfer failed");
}
Proof of Concept
Proof of Concept
The common (but not the only) scenario I will describe is this:
Transfering wrapped native token to the protocol and send out native token to the recipient. So the command execution would look like this:
TRANSFER_FROM- transfer wrapped native to the protocolWITHDRAW_NATIVE_FROM_WRAPPER- withdraw native from wrapped native to the protocolTRANSFER_NATIVE- from the protocol to the recipient
So the user send wrapped native to the protocol expecting to sent native token to the recipient, but for some reason (it could be grieving or the address is not able to receive native token, there are many reasons why it would fail) the transfer is not successful. The issue is that then that these native tokens would not be sent back to the user, but to the protocol because protocol sent them and there is no way for them to be recovered by our user which will make his funds stuck and lost forever.
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 performs a low-level call to transfer native tokens but does not check the boolean success value returned by the call.
Impact
Native tokens could become permanently stuck in the contract when a transfer fails, with no recovery path for the user.
What the attacker needed
User sends wrapped native token to protocol; recipient cannot receive native token or transfer fails
The fix
The contract should check the success of the native transfer and revert if it fails.
How it was found
- The user transfers wrapped native token to the protocol using the TRANSFER_FROM command.
- The protocol withdraws native token from the wrapper using the WITHDRAW_NATIVE_FROM_WRAPPER command.
- The protocol attempts to send native token to the recipient using the TRANSFER_NATIVE command.
- The transfer fails (for example, the recipient cannot receive native token), but the failure is ignored.
- The native tokens remain stuck in the protocol contract and cannot be recovered by the user.
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 must check whether the transfer actually worked. This contract sends the money but ignores the result, so if the recipient cannot accept it, the money stays trapped in the contract with no way to get it back.
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.