Skip to content
Smart contracts Audit finding Intermediate

Unchecked return value from low-level call()

The contract does not check the return value of a low-level call, so if the call fails, Ether can become locked in the contract. An attacker could cause this by setting the intermediate token to a contract that fails when wrapping the Ether amount.

JMukesh Follow

Originally disclosed on Code4rena

Submitted by JMukesh, also found by certora

Impact

The return value of the low-level call is not checked, so if the call fails, the Ether will be locked in the contract. If the low level is used to prevent blocking operations, consider logging failed calls.

Proof of Concept

https://github.com/code-423n4/2021-12-amun/blob/98f6e2ff91f5fcebc0489f5871183566feaec307/contracts/basket/contracts/singleJoinExit/EthSingleTokenJoinV2.sol#L26

Recommended Mitigation Steps

add condition to check return value

loki-sama (Amun) confirmed and disagreed with severity

0xleastwood (Judge) commented:

Nice find! I think this could be marked as medium as it leaks value from the protocol but it doesn’t result in assets being lost directly. It requires _INTERMEDIATE_TOKEN to point to a contract which fails upon wrapping the ETH amount.

So considering that _INTERMEDIATE_TOKEN must be improperly set, I will mark this as medium.

The original report as published on Code4rena, by JMukesh. 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 contract uses a low-level call to send Ether but does not verify its return value, so a failed call leaves Ether stuck.

Impact

If the intermediate token is set to a contract that fails when wrapping the Ether amount, Ether could be locked in the contract, but assets are not lost directly.

What the attacker needed

Intermediate token set to a failing contract

The fix

The contract should be fixed by adding a condition to check the return value of the low-level call.

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.

A low-level call is a way for a smart contract to send Ether or call another contract without automatic error checking. If the call fails and the contract does not check the result, the Ether may be stuck. Here, the contract sends Ether but ignores whether it succeeded, so a failure could lock funds.

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 JMukesh

View all

2 more disclosed reports, best first.

More from Amun 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.