Users may avoid gauge loss penalty by frontrunning the LendingTerm notifying loss #1216
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-877
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/LendingTerm.sol#L725-L825
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/main/src/loan/LendingTerm.sol#L695-L722
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/main/src/governance/ProfitManager.sol#L292-L405
Vulnerability details
In case of
LendingTerm.onBid()
, orLendingTerm.forgive()
,ProfitManager.notifyPnL()
is called to signal loss. If the loss is signalled, any holder of losing gauge has to apply the loss. Currently, the loss may be very bad for the user, because all guild tokens voted on the gauge are burned with even slightest loss. Naturally, noone wants that happening to them, hence anyone can watch the mempool for transactions incurring losses and frontrun it, saving all their GUILD tokens.Impact
Users are able to game gauge loss penalty by frontrunning the LendingTerm notifying loss.
Proof of Concept
Tools Used
Manual analysis
Recommended Mitigation Steps
Consider introducing lock time for gauge staking and unstaking.
Assessed type
Error
The text was updated successfully, but these errors were encountered: