Emptyset reserve strategies may revert when aave/compound supply limit is reached or pool owner pause/froze the pool
The DSU reserve contracts call Aave or Compound on every mint and redeem to rebalance collateral, so if those external pools are paused, frozen, or at their supply cap, the calls revert and all DSU minting and redemption fails. An attacker or whale could push the external pool to its supply cap, or governance could pause it, causing a denial of service for the DSU and Perennial protocols.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2024-08-perennial-v2-update-3-judging/issues/66
The protocol has acknowledged this issue.
Found by
Oblivionis
Summary
CompoundV3FiatReserve and AaveV3FiatReserve will interact with aave/compound pool each time new DSU token is minted/redeemed. This creates a single-point of failure. When the call to aave/compound fails, even if DSU protocol exposes only a portion of the risk to aave/compound, users are still unable to withdraw/deposit DSU. Since DSU reserves do not implement a proxy, such risk can be harmful to DSU and perennial protocol.
Root Cause
In CompoundV3FiatReserve.sol and AaveV3FiatReserve.sol, function _update() will push/pull the imbalanced part of fiat token to/from Aave V3 or Compound V3. As almost every DSU mint/Redeem creates the imbalance, _update()is called everytime:
function _update(UFixed18 collateral, UFixed18 target) internal override {
if (collateral.gt(target))
compound.withdraw(fiat, UFixed6Lib.from(collateral.sub(target)));
if (target.gt(collateral))
compound.supply(fiat, UFixed6Lib.from(target.sub(collateral)));
}
function _update(UFixed18 collateral, UFixed18 target) internal virtual override {
if (collateral.gt(target))
aave.withdraw(fiat, UFixed6Lib.from(collateral.sub(target)), address(this));
if (target.gt(collateral))
aave.deposit(fiat, UFixed6Lib.from(target.sub(collateral)), address(this), 0);
}
However, Such logic creates a single-point of failure: if the call to aave/compound fails, no DSU can get minted and no DSU can get redeemed.
Here are some possible scenarios:
- Aave v3 and Compound V3 may reach deposit limit:
https://github.com/aave/aave-v3-core/blob/master/contracts/protocol/libraries/logic/ValidationLogic.sol#L80-L87 https://github.com/compound-finance/comet/blob/2fc94d987ebd46572da93a3323b67c5d27642b1b/contracts/CometConfiguration.sol#L47
Currently, Aave Ethereum USDT market now accounts for 64.68% of the supply cap, Aave Ethereum USDC market now accounts for 66.98% of the supply cap. When market utilization increases, Aave/Compound users are incentivized to supply into the market, and is possible to reach the supply limit.
- Aave v3 and Compound V3 may get paused or retired:
https://github.com/compound-finance/comet/blob/2fc94d987ebd46572da93a3323b67c5d27642b1b/contracts/Comet.sol#L865 https://github.com/aave/aave-v3-core/blob/master/contracts/protocol/libraries/logic/ValidationLogic.sol#L77
In Nov 2023, Aave paused several markets after reports of feature issue .
Commonly in lending platforms, when a certain token or lending pool has been deemed to be too risky or have been hacked, it is retired. This has happened multiple times in Aave, with some other examples below:
GHST borrowing disabled on polygon agEUR borrowing disabled on polygon UST disabled on Venus protocol on BSC SXP disabled on Venus protocol on BSC TRXOld disabled on Venus protocol on BSC
Internal pre-conditions
No internal pre-conditions
External pre-conditions
Aave governance/admin pause/freeze the pool or aave/compound supply cap reached.
Attack Path
- Attacker can make proposals to aave/compound governance.
- Whales can DoS DSU protocol by deposit into aave/compound to reach the supply cap.
- Aave/compound markets may retire and a new one can be deployed. However DSU reserve contracts are immutable.
Impact
Emptyset reserve strategies can be a single-point of failure.
- Aave/compound governance can DoS DSU protocol, which efficiently DoS perennial protocol because no DSU can be minted and redeemed.
- When aave/compound supply cap is reached, DSU protocol will suffer a DoS.
- All related perennial accounts cannot work normally.
PoC
No need.
Mitigation
Consider set _update in a try-catch block, and add a way for Admin/Coordinator to mannually rebalance reserves.
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
Root cause
The reserve update function calls Aave or Compound without a try-catch, so any revert from the external pool blocks all DSU minting and redemption.
Impact
Aave or Compound governance pausing or freezing a pool, or the pool reaching its supply cap, could cause a denial of service for DSU and Perennial, preventing users from minting or redeeming DSU and blocking related accounts.
What the attacker needed
Aave/Compound pool paused or frozen; or Aave/Compound supply cap reached
The fix
The report suggests wrapping the external call in a try-catch and giving an admin or coordinator a way to manually rebalance reserves.
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.
DSU is a stablecoin, and its reserves are kept in lending pools like Aave and Compound to earn interest. Every time someone creates or redeems DSU, the system moves money in or out of those pools. If the pool is full, paused, or frozen, that move fails, and because the code does not handle the failure, the whole mint or redeem fails too.
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.