Deny of service in AccountantDelegate.sweepInterest
#28
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.dev/Plex-Engineer/lending-market-v2/blob/2646a7676b721db8a7754bf5503dcd712eab2f8a/contracts/Accountant/AccountantDelegate.sol#L101
Vulnerability details
Impact
The
sweepInterest
method is susceptible to denial of service.Proof of Concept
The logic of the
sweepInterest
method relative to thetreasury
is as follows:As you can see,
amtToSweep
is passed to it andredeem
that amount. Later it is checked that the balance ofcnote
in thetreasury
address must be 0. However, all calculations related toamtToSweep
come out of the balance of address(this) so if a third party sends a single tokencnote
to the address oftreasury
the method will be denied.Recommended Mitigation Steps
bool success = cnote.transfer(treasury, amtToSweep);
The text was updated successfully, but these errors were encountered: