Liquidations are impossible for some Curve pools
The reentrancy check in Notional's Curve vault calls remove_liquidity with zero amounts, which reverts for some Curve pools due to an underflow. This makes liquidations impossible for those pools, allowing bad debt to accumulate without recovery.
Source: https://github.com/sherlock-audit/2023-02-notional-judging/issues/21
Found by
usmannk
Summary
Some curve pools have implementations such that Notional liquidations always revert.
Vulnerability Detail
Liquidations are done, directly or indirectly, via the deleverageAccount function. This function calls _checkReentrancyContext to protect against read-only reentrancy.
The Curve vault's _checkReentrancyContext function uses the Curve remove_liquidity function to check the reentrancy context. However, for certain Curve pools like the CRV/ETH pool (0x8301ae4fc9c624d1d396cbdaa1ed877821d7c511, https://curve.fi/#/ethereum/pools/crveth/) calling remove_liquidity(0, [0,0]) always reverts due to an underflow.
Impact
Liquidations are not possible, users can go into bad debt and there is no way to recover the lost funds.
Code Snippet
Tool used
Manual Review
Recommendation
Use the claim_admin_fees function to check Curve's reentrancy state instead of remove_liquidity.
Discussion
jeffywu
Valid, appears that removing 1 token will be sufficient to pass the underflow check. We need to make a note of this and ensure that we either pass in a parameter of 1 or 0 based on the target pool.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
Liquidations are not possible for affected pools, so users can go into bad debt and the lost funds cannot be recovered.
What the attacker needed
Affected Curve pool; user position becomes liquidatable
The fix
The reentrancy check should use claim_admin_fees instead of remove_liquidity, or pass a non-zero amount where needed.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A liquidation is a safety mechanism that lets others close a risky loan before it causes losses. Here, a check meant to prevent a type of attack (reentrancy) used a function that fails on some pools, so the safety mechanism could never run.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.