Risk-free reward accrual in SurplusGuildMinter #65
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
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-994
edited-by-warden
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/main/src/loan/SurplusGuildMinter.sol#L114
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/main/src/loan/SurplusGuildMinter.sol#L158
Vulnerability details
Impact
Malicious user can constantly accrue risk-free reward (w/o risk of slashing) from
SurplusGuildMinter
in Guild and Credit tokens. This achieved by sandwitchingLendingTerm.repay()
,LendingTerm.partialRepay()
, andAuctionHouse.bid()
calls that haveProfitManager.notifyPnL(amount > 0)
inner-call when the profit is sent toProfitManager
and no loss occur.Because
unstake()
doesn't impose any constraints for minimal staking time, it's possible to swiftly stake and unstake credit tokens without the fear of slashing. Moreover, swift stake and unstake doesn't give time for lenders to borrow in a Lending term and block corresponding GUILD tokens in the gauge.As a synopsis, the sandwitcher has 0 risk of slashing or blocking their Credit tokens.
Proof of Concept
ProfitManager.notifyPnL(amount)
withamount > 0
using a transaction that stakes Credit tokens inSurplusGuildMinter
.ProfitManager.notifyPnL(amount)
using a transaction than unstakes Credit tokens fromSurplusGuildMinter
.Run Poc with the following command.
Tools Used
Manual review.
Recommended Mitigation Steps
SurplusGuildMinter.unstake()
should enforce a minimal time interval (or perform redeeming through a queue) so users aren't able to escape slashing. Additionally, there should be a fee for staking/unstaking inSurplusGuildMinter
to make the attack unprofitable.Assessed type
Other
The text was updated successfully, but these errors were encountered: