CDSLib::withdrawUserWhoNotOptedForLiq() tax is not stored in the treasury
Summary
CDSLib::withdrawUserWhoNotOptedForLiq() does not store the tax from the cds depositor profit, leaving these funds stuck. It must call Treasury::updateUsdaCollectedFromCdsWithdraw(), similarly to what is done when the user opts in for liquidation.
Root Cause
In CDSLib::withdrawUserWhoNotOptedForLiq(), the profit tax is not stored in the treasury.
Internal pre-conditions
None.
External pre-conditions
None.
Attack Path
- Cds depositor who did not opt in for liquidation withdraws, and the profit tax to the protocol is not stored and gets stuck.
Impact
Stuck funds.
PoC
None.
Mitigation
Call Treasury::updateUsdaCollectedFromCdsWithdraw() on the profit.