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
- Users deposit cds.
- Users borrow.
- Malicious user calls
borrowing::calculateCumulativeRate()any number of times. - 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.
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
- Users deposit into the CDS.
- Users borrow funds.
- A malicious user calls the cumulative rate function repeatedly.
- 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.