Skip to content
Business logic Audit finding Intermediate

Checking yieldBearingToken against u instead of backingToken

The lend function for Tempus checks the yield-bearing token instead of the backing token, so it fails with the correct market. An attacker could not exploit this to steal funds, but it prevents legitimate lending.

datapunk Follow

Originally disclosed on Code4rena

Submitted by datapunk

The lend function for tempus will fail with the right market.

Proof of Concept

Checks if (ITempus(principal).yieldBearingToken() != IERC20Metadata(u)), while it should check ITempus(principal).backingToken()

Recommendation

Do this instead:

    if (ITempus(principal).backingToken() != IERC20Metadata(u))

sourabhmarathe (Illuminate) confirmed, but disagreed with severity

kenzo (warden) commented:

I think should probably be medium severity as user funds not at risk.

gzeoneth (judge) decreased severity to Medium


The original report as published on Code4rena, by datapunk. 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 developer used the wrong token getter (yieldBearingToken instead of backingToken) in a comparison.

Impact

The lend function fails for the correct market, but user funds are not at risk.

What the attacker needed

None

The fix

The comparison should use backingToken() instead of yieldBearingToken().

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.

This is a smart contract bug where a function compares the wrong token. The code checks for a token that represents yield, but it should check the token that actually backs the loan. As a result, the function does not work when it should, but no money is lost.

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 datapunk

View all

1 more disclosed report, best first.

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