Skip to content
Business logic Audit finding Intermediate

User could lose underlying tokens when redeeming from the IdleYieldSource

The redeemToken function in IdleYieldSource used the wrong variable (redeemedShare instead of redeemAmount) when redeeming underlying tokens from Idle Finance, causing users to receive fewer tokens than they should.

shw Follow

Originally disclosed on Code4rena

Submitted by shw

The redeemToken function in IdleYieldSource uses redeemedShare instead of redeemAmount as the input parameter when calling redeemIdleToken of the Idle yield source. As a result, users could get fewer underlying tokens than they should.

When burning users’ shares, it is correct to use redeemedShare (line 130). However, when redeeming underlying tokens from Idle Finance, redeemAmount should be used instead of redeemedShare (line 131). Usually, the tokenPriceWithFee() is greater than ONE_IDLE_TOKEN, and thus redeemedShare is less than redeemAmount, causing users to get fewer underlying tokens than expected.

Recommend changing redeemedShare to redeemAmount at line L131.

PierrickGT (PoolTogether) confirmed and patched:

PR: https://github.com/pooltogether/idle-yield-source/pull/4

The original report as published on Code4rena, by shw. 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 a copy-paste or variable mix-up: the function used redeemedShare instead of redeemAmount when calling the external redeem function.

Impact

Users could lose underlying tokens because they receive fewer than expected when redeeming.

What the attacker needed

None

The fix

The issue was fixed by changing redeemedShare to redeemAmount at line 131.

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 you redeem tokens from a yield source, the contract should give you the correct amount of underlying tokens. Here, it used the number of shares you burned instead of the amount you requested, so you got less than you should.

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 shw

View all

22 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.

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.