Skip to content
Business logic Audit finding Intermediate

Interest debt is capped after a year

The interest calculation function caps the elapsed time at one year, so interest owed does not grow beyond that period. An attacker could exploit this by not interacting with the contract for over a year, missing out on some rewards, though the impact is small because the only current caller likely never exceeds a year.

Vader Protocol contest

Originally disclosed on Code4rena

The Utils.getInterestOwed function computes the _interestPayment as:

uint256 _interestPayment =
  calcShare(
      timeElapsed,
      _year,
      getInterestPayment(collateralAsset, debtAsset)
  ); // Share of the payment over 1 year

However, calcShare caps timeElpased to _year and therefore the owed interest does not grow after a year has elapsed.

The impact is probably small because the only call so far computes the elapsed time as block.timestamp - mapCollateralAsset_NextEra[collateralAsset][debtAsset]; which most likely will never go beyond a year.

It’s still recommended to fix the logic bug in case more functions will be added that use the broken function.

Recommend using a different function than calcShare that does not cap.

strictly-scarce (vader) confirmed:

A member who doesn’t interact with the contract for more than a year misses out on some rewards, so severity:1

The original report as published on Code4rena. 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

The function calcShare caps the elapsed time to one year, so interest stops growing after that period.

Impact

A user who does not interact with the contract for more than a year misses out on some rewards, but the impact is probably small because the only current caller likely never exceeds a year.

What the attacker needed

User does not interact for over a year

The fix

The logic should be fixed by using a different function than calcShare that does not cap the elapsed time.

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 that calculates interest stops increasing after one year. If someone waits longer than a year to interact, they lose out on extra interest they should have earned. The fix is to use a different calculation that does not cap the time.

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 from Vader Protocol 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.