Submitted by nonseodion, also found by Toshii, lanrebayode77, Aymen0909, KingNFT, juancito, 00xSEV, fnanni, oakcobalt, chaduke, israeladelaja, Ephraim, zach (1, 2), Drynooo, solmaxis69, pkqs90, wangxx2026, ether_sky, 0x3b, LeoGold, Jorgect, 0xAlix2, 0xRobocop, 0xanmol, djxploit, ayden, and klau5
When a user repays the USDS he has borrowed, it is taken from him and kept for burning. The Liquidizer contract is updated with the new amount repaid. The USDS is burnt whenever the performUpkeep function is called on Liquidizer by the Upkeep contract during upkeep.
The USDS collected is sent to the USDS contract which can be burned whenever burnTokensInContract is called. The amount of USDS to be burnt in the Liquidizer contract is also increased by the incrementBurnableUSDS call. This increases the usdsThatShouldBeBurned variable on the Liquidizer.
During upkeep, the Liquidizer first checks if it has enough USDS balance to burn i.e usdsBalance >= usdsThatShouldBeBurned. If it does it burns them else it converts Protocol Owned Liquidity (POL) to USDS and burns it to cover the deficit. Burning POL allows the protocol to cover bad debt from liquidation.
Since the usdsThatShouldBeBurned variable will always be increased without increasing the Liquidizer balance, it will always sell POL to cover the increase.
If the POL is exhausted, the protocol cannot cover bad debt generated from liquidations. This will affect the price of USDS negatively.
An attacker can borrow and repay multiple times to exhaust POL and create bad debt or it could just be done over time as users repay their USDS.
This will affect the price of USDS negatively.
This test can be run in CollateralAndLiquidity.t.sol.
Send the repaid USDS to the Liquidizer.
othernet-global (Salty.IO) confirmed and commented:
Status: Mitigation confirmed. Full details in reports from 0xpiken, zzebra83, and t0x1c.
