Protocol mechanics incorrectly assume 1 USDC will always be worth 1 USD
The protocol assumes 1 USDC always equals 1 USD when calculating collateral levels, so if USDC depegs the collateral level is miscomputed. This could lead to incorrect minting and redeeming of bond and leverage tokens, causing loss of funds for users.
Source: https://github.com/sherlock-audit/2024-12-plaza-finance-judging/issues/797
This issue has been acknowledged by the team but won't be fixed at this time.
Found by
0xadrii, PNS
Summary
The protocol mechanics assume 1 USDC == 1 USD. This is incorrect, and could lead to a loss of funds for users in case USDC depegs.
Root Cause
Plaza is designed to force bondETH to be worth 100 USDC. This is mentioned several times accross the documentation, and can also be seen in the mint/redeem calculations in the codebase, where BOND_TARGET_PRICE is set to 100 to force the 100 USDC price:
// Pool.sol
function getCreateAmount(
TokenType tokenType,
uint256 depositAmount,
uint256 bondSupply,
uint256 levSupply,
uint256 poolReserves,
uint256 ethPrice,
uint8 oracleDecimals
) public pure returns (uint256) {
...
// Compute collateral level, in PRECISION decimals
uint256 collateralLevel = (tvl * PRECISION) /
(bondSupply * BOND_TARGET_PRICE);
We can also be sure that BOND_TARGET_PRICE refers to 100 USDC and not 100 USD, given that the protocol Auction system is designed to distribute the bonds in the form of USDC, and the total amount of coupons to distribute is computed by considering the current supply of bond tokens and a fixed amount of USDC (given by sharesPerToken) per bond token:
// File: Pool.sol
function startAuction() external whenNotPaused {
...
// Normalize bondETH supply
uint256 normalizedTotalSupply = bondToken.totalSupply().normalizeAmount(
bondDecimals,
maxDecimals
);
// Normalize shares (USDC) amount
uint256 normalizedShares = sharesPerToken.normalizeAmount(
sharesDecimals,
maxDecimals
);
// Calculate the coupon amount to distribute
uint256 couponAmountToDistribute = (normalizedTotalSupply *
normalizedShares).toBaseUnit(
maxDecimals * 2 - IERC20(couponToken).safeDecimals()
);
...
}
This makes it clear that the protocol aims at pricing bond tokens in USDC, and not in USD.
The problem is that this leads to Plaza incorrectly assuming that 1 USDC == 1 USD. When computing the amount of tokens to mint, the total TVL in the pool is computed in USD, instead of USDC:
// File: Pool.sol
function simulateCreate(
TokenType tokenType,
uint256 depositAmount
) public view returns (uint256) {
...
return
getCreateAmount(
tokenType,
depositAmount,
bondSupply,
levSupply,
poolReserves,
getOraclePrice(reserveToken, USD), // <---- !! The price for the reserve token is fetched in USD, not USDC
getOracleDecimals(reserveToken, USD)
).normalizeAmount(COMMON_DECIMALS, assetDecimals);
}
Then, in getCreateAmount, the TVL will be computed in USD, making the numerator in the collateralLevel calculation be in USD, but the denominator be in USDC:
// File: Pool.sol
function getCreateAmount(
TokenType tokenType,
uint256 depositAmount,
uint256 bondSupply,
uint256 levSupply,
uint256 poolReserves,
uint256 ethPrice,
uint8 oracleDecimals
) public pure returns (uint256) {
...
uint256 tvl = (ethPrice * poolReserves).toBaseUnit(oracleDecimals);
uint256 collateralLevel = (tvl * PRECISION) /
(bondSupply * BOND_TARGET_PRICE);
...
}
This can lead to an incorrect computation of the pool’s current collateral level in case USDC depegs, effectively leading to a loss of funds.
Internal Pre-conditions
No response
External Pre-conditions
No response
Attack Path
Considering the following scenario:
- The current
poolReservesis 100 WETH. - The
ethPricereported by the oracle is $3000. - The
bondSupplyis 28.
In normal conditions (USDC is at peg with USD), the collateral level would be below the COLLATERAL_THRESHOLD, and the mint/redeem computations for bond and leverage tokens should be done considering the case where COLLATERAL_THRESHOLD < 1.2:
TVL= 100 WETH * 3000 = $300000bondExpectedValuation= 28 *BOND_TARGET_PRICE= $2800collateralLevel≈TVL/bondExpectedValuation≈ 107.14, which is below theCOLLATERAL_THRESHOLD.
However, in case USDC depegs, say to $0.90 per USDC, the real TVL and collateral levels should be:
TVL= 100 WETH * 3000 = $300000- bond expected valuation = 23 *
BOND_TARGET_PRICE* 0,90 = $2070
collateralLevel ≈ TVL / bondExpectedValuation ≈ 144, which is above the COLLATERAL_THRESHOLD.
Note: USDC hit an all-time low to around $0.88 USD per USDC, more details here.
Impact
As demonstrated in the attack path, incorrectly considering that 1 USDC is always worth 1 USD could break the minting/redeeming expected mechanics, as the collateral level computations will be incorrect, effectively breaking the expected behavior of the protocol.
PoC
No response
Mitigation
Consider adding an oracle to convert the bondExpectedValuation to USD.
Another way to mitigate this issue is by computing the TVL in USDC, instead of USD. This would need changes in getOraclePrice function in the OracleReader, as an additional step should be included to convert from USD to USDC.
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 protocol uses a USD-denominated oracle price for the reserve token while the bond target price is denominated in USDC, mixing units and assuming a 1:1 peg.
Impact
Incorrect collateral level computations could break the minting and redeeming mechanics, potentially leading to a loss of funds for users if USDC depegs.
What the attacker needed
USDC depegs from USD
The fix
The issue was acknowledged but not fixed; the recommended mitigation is to add an oracle to convert the bond expected valuation to USD, or to compute TVL in USDC instead of USD.
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.
This report is about a stablecoin called USDC that is supposed to always be worth one US dollar. The protocol treats it as always equal to a dollar, but if USDC's market price drops below a dollar, the protocol's calculations for how much collateral it has become wrong. That could cause users to get the wrong amount of tokens when they mint or redeem.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.