Malicious user can call borrowing::calculateCumulativeRate() any number of times to inflate debt rate as lastEventTime is not updated
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.