Skip to content
Business logic Audit finding Intermediate

No withdrawal possible for ETH TOKE pool

The withdraw function of the ETH Tokemak pool has an extra parameter asEth, unlike other pools, so when the staking token is ETH/WETH, withdrawals are impossible and funds become locked.

Lambda Follow

Originally disclosed on Code4rena

Submitted by Lambda

The withdraw function of the ETH Tokemak pool has an additional parameter asEth. This can be seen in the Tokemak Github repository or also when looking at the deployed code of the ETH pool. Compare that to e.g. the USDC pool, which does not have this parameter.

This means that the call to withdraw will when the staking token is ETH / WETH and no withdrawals would be possible.

Proof of Concept

A new Staking contract with ETH / WETH as the staking token is deployed. Deposits in Tokemak work fine, so users stake their tokens. However, because of the previously described issue, no withdrawal is possible, leaving the funds locked.

Recommended Mitigation Steps

Handle the case where the underlying asset is WETH / ETH separately and pass this boolean in that case.

toshiSat (Yieldy) confirmed and resolved


The original report as published on Code4rena, by Lambda. 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 withdrawal logic does not account for the ETH pool's extra boolean parameter, causing the call to fail when the staking token is ETH/WETH.

Impact

Funds deposited in the ETH/WETH pool become permanently locked because withdrawals are impossible.

What the attacker needed

A Staking contract with ETH/WETH as staking token

The fix

The withdrawal logic should handle the ETH/WETH case separately and pass the required boolean parameter.

How it was found

  1. Deploy a new Staking contract with ETH/WETH as the staking token.
  2. Users deposit tokens, which works fine.
  3. Attempt to withdraw, which fails because the withdraw call does not handle the extra asEth parameter.

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 function for withdrawing funds expects a different set of inputs when the token is ETH compared to other tokens. Because the code always calls it the same way, the call fails for ETH, so users cannot get their money 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.

More by Lambda

View all

64 more disclosed reports, best first.

More from Yieldy contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.