Skip to content
Business logic Audit finding Intermediate

Users can sell `BondToken` at a higher price by manipulating the `collateralLevel` from `< 120%` to `> 120%` by purchasing `LeverageToken`

The redemption price of BondToken depends on the collateralLevel, which can be manipulated by buying LeverageToken. An attacker can buy LeverageToken to push the collateralLevel above 120%, then redeem BondToken at a higher fixed price, and finally sell back the LeverageToken for a profit.

056Security Follow with 0xc0ffEE, KupiaSec and 5 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-12-plaza-finance-judging/issues/896

Found by

056Security, 0xc0ffEE, KupiaSec, bigbear1229, future, novaman33, t0x1c, zraxx

Summary

Buying LeverageToken increases TVL, which in turn raises the collateralLevel.

When redeeming BondToken, the redemption amount is determined by the collateralLevel. The calculation of the redemption amount varies depending on whether the collateralLevel is above or below 120%.

Therefore, BondToken redeemers can acquire more underlying assets by manipulating the collateralLevel from < 120% to > 120% through purchasing LeverageToken, ultimately resulting in a profit.

Root Cause

The getRedeemAmount() function calculates the redeemRate based on whether the collateralLevel is above or below 120%.

When collateralLevel < 120%, 80% of TVL is allocated for BondToken holders. In contrast, when collateralLevel > 120%, the price of BondToken is fixed at 100.

This vulnerability provides malicious users with an opportunity to manipulate the collateralLevel by purchasing LeverageToken, allowing them to redeem their BondTokens at a higher rate.

Solidity
      function getRedeemAmount(
        ...
        
        uint256 collateralLevel;
        if (tokenType == TokenType.BOND) {
498       collateralLevel = ((tvl - (depositAmount * BOND_TARGET_PRICE)) * PRECISION) / ((bondSupply - depositAmount) * BOND_TARGET_PRICE);
        } else {
          multiplier = POINT_TWO;
          assetSupply = levSupply;
502       collateralLevel = (tvl * PRECISION) / (bondSupply * BOND_TARGET_PRICE);
        ...
        
        uint256 redeemRate;
511     if (collateralLevel <= COLLATERAL_THRESHOLD) {
          redeemRate = ((tvl * multiplier) / assetSupply);
513     } else if (tokenType == TokenType.LEVERAGE) {
          redeemRate = ((tvl - (bondSupply * BOND_TARGET_PRICE)) / assetSupply) * PRECISION;
515     } else {
          redeemRate = BOND_TARGET_PRICE * PRECISION;
        }
        
        ...
      }

Internal pre-conditions

External pre-conditions

Attack Path

Let's consider the following scenario:

  • Current State of the Pool:
    • levSupply: 100
    • bondSupply: 100
    • TVL: $11000
  • Bob wants to redeem 50 BondToken. Expected Values:
    • collaterlLevel: (11000 - 100 * 50) / (100 - 50) = 120% (see line 498)
    • Price of BondToken: 11000 * 0.8 / 100 = 88 (see the case at line 511)
    • Price of LeverageToken: 11000 * 0.2 / 100 = 22 (see the case at line 511)

As a result, Bob can only redeem 50 * 88 = 4400.

However, Bob manipulates collateralLevel.

  1. Bob buys 10 LeverageToken by using $220:

    • levSupply: 100 + 10 = 110
    • bondSupply: 100
    • TVL: 11000 + 220 = 11220
  2. Bob then sells 50 BondToken:

    • collaterlLevel: (11220 - 100 * 50) / (100 - 50) = 124.4% (see line 498)
    • price of BondToken: 100 (see the case at line 515)

    Bob receives 100 * 50 = 5000.

    • TVL: 11220 - 5000 = 6220
    • bondSupply: 100 - 50 = 50
  3. Bob sells back 10 LeverageToken.

    • collaterlLevel: 6220 / 50 = 124.4% (see line 502)
    • Price of LeverageToken: (6220 - 100 * 50) / 110 = 11 (see the case at line 513)
    • Bob receives 10 * 11 = 110.

As you can see, Bob was initially able to redeem only $4400. However, by manipulating collateralLevel, he can increase his redemption to -220 + 5000 + 110 = 4890. Thus, he can profit by 4890 - 4400 = 490.

Impact

BondToken redeemers can obtain more than they are entitled to by manipulating the collateralLevel through purchasing LeverageToken.

PoC

Mitigation

The current price mechanism should be improved.

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/Convexity-Research/plaza-evm/pull/155

The original report as published on Sherlock, by 056Security. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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

BondToken redeemers can obtain more than they are entitled to by manipulating the collateralLevel through purchasing LeverageToken.

What the attacker needed

Attacker has BondToken to redeem; attacker has funds to buy LeverageToken; pool has sufficient liquidity

The fix

The protocol team fixed this issue in the following PRs/commits: https://github.com/Convexity-Research/plaza-evm/pull/155

How it was found

  1. Bob buys 10 LeverageToken for $220, increasing TVL and collateralLevel.
  2. Bob redeems 50 BondToken at the higher price of 100 each, receiving $5000.
  3. Bob sells back the 10 LeverageToken, receiving $110.
  4. Bob's net profit is $490 compared to redeeming without manipulation.

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.

The pool has two tokens: BondToken and LeverageToken. The price at which you can sell BondToken changes depending on a ratio called collateralLevel. By buying LeverageToken, you can temporarily change that ratio to get a better price for your BondToken, then sell the LeverageToken back. This lets you take more money out of the pool than you should.

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.

More by 056Security

View all

13 more disclosed reports, best first.

More from Plaza Finance

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.