USDS borrowers can prevent liquidation by periodically touching their liquidities #363
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-312
satisfactory
satisfies C4 submission criteria; eligible for awards
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L154
Vulnerability details
Impact
In current implementation, liquidation would fail while borrowers are in operation cool down. Users could periodically add negligible liquidity to keep in cool down and prevent liquidation in realistic time range such as some days.
Proof of Concept
The issue arises on L154 of
liquidateUser()
function, the last parameteruseCooldown
is set totrue
, this would trigger revert on L107 if the user being liquidated is undercooldown
.Now, let's say the WBTC or WETH price quickly fall and make some users' collateral value decreasing to near liquidation threshold. Users could add negligible liquidity to refresh
coolDown
time rather than increasing liquidity or repaying USDS to prevent liquidation. To be even worse, users could try to refreshcoolDown
repeatedly. This would significantly increase depeg risk of USDS in such market situation.Tools Used
Manually review
Recommended Mitigation Steps
See PoC
Assessed type
Error
The text was updated successfully, but these errors were encountered: