Skip to content
Smart contracts Audit finding Intermediate

Actual yield source check on address will succeed for non-existent contract

The contract uses a low-level staticcall to check if a yield source implements a function, but this check returns true for non-existent accounts (like EOAs). An attacker could cause the pool to be initialised with an EOA address, making the pool unusable and forcing redeployment.

0xRajeev Follow

Originally disclosed on Code4rena

Submitted by 0xRajeev

Low-level calls call/delegatecall/staticcall return true even if the account called is non-existent (per EVM design). Solidity documentation warns:

“The low-level functions call, delegatecall and staticcall return true as their first return value if the account called is non-existent, as part of the design of the EVM. Account existence must be checked prior to calling if needed.”

The staticcall here will return True even if the _yieldSource contract doesn’t exist at any incorrect-but-not-zero address, e.g. EOA address, used during initialization by accident.

The hack, as commented, to check if it’s an actual yield source contract, will fail if the address is indeed a contract account which doesn’t implement the depositToken function. However, if the address is that of an EOA account, the check will pass here but will revert in all future calls to the yield source forcing contract redeployment after the pool is active. Users will not be able to interact with the pool and abandon it.

Recommend that a contract existence check should be performed on _yieldSource prior to the depositToken function existence hack for determining yield source contract.

asselstine (PoolTogether) confirmed

The original report as published on Code4rena, by 0xRajeev. 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 code relies on the success of a low-level staticcall to verify contract existence, but such calls return true for non-existent accounts.

Impact

If the yield source address is an EOA, the check passes but future calls revert, making the pool unusable and forcing redeployment.

What the attacker needed

Pool initialisation with wrong address

The fix

A contract existence check should be performed on _yieldSource before the depositToken function existence check.

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 smart contract can call another address without knowing if it's a real contract. The call returns success even if the address is empty, so a check that only looks at success can be fooled. This means a pool could be set up with a wrong address and then break.

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 0xRajeev

View all

61 more disclosed reports, best first.

More from PoolTogether

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.