The StabilityPool.sol contract, which is responsible for liquidating unhealthy positions, lacks any mechanism to obtain or hold crvUSD tokens that are required to execute liquidations. While the StabilityPool can receive rTokens (which represent crvUSD deposits), it cannot access the actual crvUSD tokens needed for the liquidation process. This fundamental disconnect in token flow renders the liquidation mechanism non-functional.
The vulnerability stems from an architectural misalignment between the token flow design and the liquidation requirements. Let's examine the critical path that reveals this issue:
When a position requires liquidation, the LendingPool expects the StabilityPool to provide crvUSD tokens:
However, the token flow in the protocol never provides the StabilityPool with crvUSD. Instead:
Users deposit crvUSD into the LendingPool, which transfers it to the rToken contract
Users receive rTokens representing their deposit
Users can deposit these rTokens into StabilityPool and receive deTokens
The crvUSD remains locked in the rToken contract with no mechanism for the StabilityPool to access it
The StabilityPool contract has no functions that would allow it to:
Receive crvUSD directly
Convert rTokens to crvUSD
Access the crvUSD held by the rToken contract
High - Unhealthy positions cannot be liquidated and the protocol will build up bad debt and eventually become insolvent
High - Liquidations are an integral part of the system and this will occur every time.
Convert the project into a foundry project, ensuring test in foundry.toml points to a designated test directory.
Comment out the forking object from the hardhat.congif.cjs file:
Copy the following code into the test folder:
Run forge test -vvvv to see the traces
There are multiple different approaches that can be taken to fix this.
Modify the liquidation mechanism to work with rTokens instead of requiring crvUSD
Create a new mechanism for the StabilityPool to redeem rTokens for crvUSD specifically for liquidations
Restructure the protocol's token flow to ensure the StabilityPool can maintain its own crvUSD reserves for liquidations, separate from the rToken system
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.