Skip to content
Business logic Audit finding Intermediate

Malicious user can call `borrowing::calculateCumulativeRate()` any number of times to inflate debt rate as `lastEventTime` is not updated

The borrowing contract's cumulative rate calculation does not update the stored last event time, so the rate can be recalculated repeatedly and grow without bound. An attacker could call it many times, forcing borrowers to repay far more debt than expected.

0x37 Follow with 0x73696d616f, 0xAadi and 12 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-11-autonomint-judging/issues/778

Found by

0x37, 0x73696d616f, 0xAadi, Audinarey, Cybrid, EgisSecurity, John44, KobbyEugene, PeterSR, RampageAudit, almurhasan, durov, onthehunt, super_jack, volodya

Summary

borrowing::calculateCumulativeRate() does not update lastEventTime, so the cumulative rate may be increased unbounded, forcing users to repay much more debt.

Root Cause

In borrowing::calculateCumulativeRate(), lastEventTime is not updated.

Internal pre-conditions

None.

External pre-conditions

None.

Attack Path

  1. Users deposit cds.
  2. Users borrow.
  3. Malicious user calls borrowing::calculateCumulativeRate() any number of times.
  4. Borrowers have to repay much more debt.

Impact

Borrowers take massive losses as they have to repay much more.

PoC

See links above.

Mitigation

Update lastEventTime.

The original report as published on Sherlock, by 0x37. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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 cumulative rate function fails to write back the updated last event time, so repeated calls compound the rate instead of being time-gated.

Impact

Borrowers could take massive losses because they have to repay much more debt.

What the attacker needed

Ability to call the contract function; borrowers with outstanding debt

The fix

The function should update the last event time so the rate cannot be compounded by repeated calls.

How it was found

  1. Users deposit into the CDS.
  2. Users borrow funds.
  3. A malicious user calls the cumulative rate function repeatedly.
  4. Borrowers are left owing much more debt.

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 keeps track of interest using a running rate that should only advance once per time period. Because the code forgets to record when it last ran, anyone can trigger the calculation again and again, and each run adds more interest. That means people who borrowed end up owing much more than they 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 0x37

View all

79 more disclosed reports, best first.

More from Autonomint Colored Dollar V1

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.