Closed c4-bot-1 closed 8 months ago
Picodes marked the issue as primary issue
othernet-global (sponsor) confirmed
Note: the overcollateralized stablecoin mechanism has been removed from the DEX.
https://github.com/othernet-global/salty-io/commit/f3ff64a21449feb60a60c0d60721cfe2c24151c1
Picodes marked the issue as satisfactory
Picodes marked issue #137 as primary and marked this issue as a duplicate of 137
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/stable/CollateralAndLiquidity.sol#L124-L125
Vulnerability details
Impact
Protocol Owned Liquidity from the DAO is drained as the
Liquidizer
doesn't have enough USDS to cover the upkeep process.Proof of Concept
The problem is that USDS tokens are sent to the
usds
contract instead of theliquidizer
.CollateralAndLiquidity.sol#L124-L125
First of all note how the comment refers to a
USDS.performUpkeep
function, which doesn't exist on theUSDS
contract, but should refer to the upkeep in theLiquidizer
contract.The correct implementation can be seen when positions are liquidated, as they transfer assets to the
Liquidizer
, as well as incrementing the burnable USDS.In contrast, the
repayUSDS()
function increases the burnable USDS without transfering the asset to the liquidizer (as it is transfered to theUSDS
contract instead):CollateralAndLiquidity.sol#L124-L128
When
incrementBurnableUSDS()
is called, it increases theusdsThatShouldBeBurned
variable.This is used during the liquidizer upkeep, but as the
incrementBurnableUSDS
will be increased without actually sending USDS this check will returnfalse
, leading to the following action:Liquidizer.sol#L117-L124
In short, it will "withdraw Protocol Owned Liquidity from the DAO" as described here to cover the shortage of USDS in the
Liquidizer
contract, slowly draining the POL of the DAO.Recommended Mitigation Steps
Send the assets to the liquidizer:
Assessed type
Other