Skip to content
Request an audit

‹ All findings

CDSLib::withdrawUserWhoNotOptedForLiq() tax is not stored in the treasury

Crit/HighAutonomint·Sherlock · Hedged stablecoin · 4th December 2024CodebaseH-23

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

  1. 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.