User can prevent anyone from liquidating him, by continuously adding dust liquidity #24
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-312
edited-by-warden
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/main/src/stable/CollateralAndLiquidity.sol#L140-L188
Vulnerability details
Impact
Users can be liquidated if their collateral to USDS ratio falls below a certain ratio/percent. There's also another concept while adding/removing liquidity to the protocol and that is the cooldown, where users have to wait a certain period before doing another action, either addition or removal. However, the liquidate function
liquidateUser
is using:while setting
useCooldown
totrue
, so it will check the last user's action before liquidating him. Users can abuse this and continuously (when the cooldown passes) add dust liquidity which blocks anyone from liquidating them, and the function will always revert withMust wait for the cooldown to expire
.Proof of Concept
Tools Used
Manual review + vscode
Recommended Mitigation Steps
Replace the following in
liquidateUser
function:with
Assessed type
DoS
The text was updated successfully, but these errors were encountered: