Skip to content

Sherlock

Perennial V2 Update #3

Every publicly disclosed report for Perennial V2 Update #3 and what kind of bugs they were.

disclosed reports
21
most reported class
Business logic
bug classes found
4
first disclosure
2024
Find Perennial V2 Update #3 on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Perennial V2 Update #3 chose to make public.

Business logic

Maliciously specifying a very large intent.price will result in a large gain at settlement, stealing funds

The settlement logic calculates profit and loss using the difference between the order's specified price and the current version price, but does not limit how far the specified price can deviate from the market price. An attacker can submit an order with an extremely high price and minimal collateral, then settle to generate a large profit that is converted to collateral, stealing funds.

Perennial V2 Update #3

High
Business logic

Market coordinator can set `staleAfter` to a huge value allowing anyone to steal all market collateral when there are no transactions for some time

The market coordinator could set the staleAfter risk parameter to an arbitrarily large value because there was no validation. This allowed them to open a delta-neutral position, wait for the price to move, withdraw collateral from the losing side, and then close the winning side to steal all market collateral.

Perennial V2 Update #3

High
Smart contracts

Corrupted storage after upgrade in the `MarketFactory` contract

The MarketFactory contract upgrade added a new mapping between existing storage slots, causing storage corruption. After the upgrade, the contract would read and write to incorrect slots, breaking the system unpredictably.

Perennial V2 Update #3

Medium
Business logic

_ineligible() redemptionEligible is miscalculated

The Vault contract's _ineligible() function incorrectly subtracts the current deposit amount from totalCollateral when calculating redemptionEligible, even though that deposit is not yet part of totalCollateral. This makes redemptionEligible too small, causing too many positions to be opened and potentially preventing proper claimAssets.

Perennial V2 Update #3

Medium
Business logic

TriggerOrder.notionalValue() Using the wrong latestPositionLocal to calculate the value causes the user to overpay fees

The TriggerOrder contract calculated the notional value for interface fees using the latest position instead of the current position, which could cause users to overpay fees when closing a position with a pending decrease. An attacker could exploit this to make victims pay more fees, but the impact is limited to fee overpayment.

Perennial V2 Update #3

Medium
Business logic

The `RiskParameter.liquidationFee` variable is not treated and validated as a percentage value, leading to breaking protocol invariants

The liquidationFee parameter was changed from a fixed amount to a percentage but was still validated against fixed-value protocol parameters, allowing a coordinator to set a liquidation fee that exceeds the intended maximum. This could let a malicious coordinator extract excessive fees from liquidated accounts, potentially causing bad debt.

Perennial V2 Update #3

Medium
Access control

Market coordinator can liquidate all users in the market

A market coordinator can set margin and maintenance ratios and fees to extreme values, making all user positions unhealthy and allowing the coordinator to liquidate them and collect fees. This can steal at least 1% from all market users.

Perennial V2 Update #3

High
Business logic

Perennial account users with rebalance group may suffer a donation attack

A flaw in the rebalance logic allows an attacker to repeatedly trigger rebalances by donating a tiny amount of collateral to a victim's empty market group, draining the victim's account balance through keeper fees or transfers. The attacker can repeat this to drain all DSU and USDC in the victim's account.

Perennial V2 Update #3

High
Business logic

The `Market.migrate()` function has no effect and does not migrate `PositionStorageGlobal` to the new storage layout, breaking the migration assumption

The migrate() function for global positions does not update the storage layout because the read() and store() functions still use the old two-slot layout, so the migration from version 2.2 to 2.3 does not consolidate the maker value into slot 0. This could lead to future errors if the deprecated maker is assumed removable, potentially rendering the protocol unusable.

Perennial V2 Update #3

Medium
Access control

Anyone can cancel other accounts `nonces` and `groups`, leading to griefing their `Intents`

The verifier contracts only check that a signature is valid for the signer address, but do not verify that the signer is authorised for the account whose nonce or group is being cancelled. An attacker can therefore cancel any user's pending intents or groups by submitting a valid signature from any address.

Perennial V2 Update #3

Medium
DoS

`MultiInvoker`, `Manager` and `Account` unexpected reverts in certain conditions due to AAVE reverting on deposits and withdrawals with 0 amount

The AAVE v3 pool reverts on deposits or withdrawals of zero amount, but the reserve strategy did not check for zero after converting from 18 to 6 decimals. This could cause unexpected reverts for users withdrawing full USDC amounts or for orders with interface fees, potentially blocking withdrawals or order execution.

Perennial V2 Update #3

Medium
Business logic

settle() asyncFee is left in the KeepFactory and is not transfer to the keeper

The settle() function in KeeperFactory transfers asyncFee from KeeperOracle to the factory contract but does not forward it to the keeper who called the function. As a result, the fee remains locked in the factory contract with no way to withdraw it.

Perennial V2 Update #3

Medium
Business logic

Keepers can lose compensation fee

A keeper's compensation fee could be reduced to zero by a user front-running the keeper's transaction and updating the order with a lower maxFee. This allowed the user to grief the keeper, causing the keeper to lose the fee.

Perennial V2 Update #3

Medium
DoS

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.

Perennial V2 Update #3

Medium
Business logic

Market coordinator can steal all market collateral by changing adiabatic fees

A market coordinator can set adiabatic fees to zero, open large maker and taker positions, then raise the fees to the maximum and close the positions to collect the fees. This shifts the fee difference onto the market's global exposure, which the owner must cover, allowing the coordinator to drain all market collateral.

Perennial V2 Update #3

High
Business logic

Market coordinator can steal all market collateral by abusing very low value of `scale`

A market coordinator could set the fee scale parameter to a very low value, causing the proportional fee formula to charge fees that exceed the position size. By opening a large maker position and a large unsettled taker position, then lowering the scale, the coordinator could settle the taker into bad debt and withdraw the inflated maker profit, stealing all market collateral.

Perennial V2 Update #3

High
Access control

Lack of access control in the `MarketFactory.updateExtension()` function

The `MarketFactory.updateExtension()` function lacks an `onlyOwner` modifier, allowing any attacker to set themselves as an extension. This grants them operator privileges over any account, enabling them to withdraw collateral and cause loss of funds.

Perennial V2 Update #3

High