Skip to content

Sherlock

Perennial V2 Update #2

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

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

Disclosed reports

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

Business logic

Requested oracle versions, which have expired, must return this oracle version as invalid, but they return it as a normal version with previous version's price instead

Expired oracle versions were committed with the previous valid version's price, so the oracle's validity check (which only treats a zero price as invalid) reported them as valid. The market then kept orders that should have been invalidated, letting users open or close positions when they should not be able to.

Perennial V2 Update #2

High
Business logic

ChainlinkFactory will pay non-requested versions keeper fees

The ChainlinkFactory contract's fee calculation ignores the number of requested versions, so it pays keeper fees for both requested and non-requested versions. An attacker could submit non-requested versions to drain the factory's fee balance, though they must include at least one requested version.

Perennial V2 Update #2

Medium
Business logic

When vault's market weight is set to 0 to remove the market from the vault, vault's leverage in this market is immediately set to max leverage risking position liquidation

Setting a market's weight to zero to remove it from a vault causes the next rebalance to withdraw collateral down to the minimum margin, leaving the vault's position at maximum leverage. This exposes the vault to liquidation and can temporarily brick the vault if collateral falls below the margin requirement.

Perennial V2 Update #2

Medium
Business logic

Vault global shares and assets change will mismatch local shares and assets change during settlement due to incorrect `_withoutSettlementFeeGlobal` formula

The vault's global settlement fee calculation subtracts the full settlement fee for both deposits and redeems, while local calculations subtract only a proportional share. This causes local shares and assets to exceed global ones, leading to underflows that prevent users from redeeming or claiming funds.

Perennial V2 Update #2

High
Business logic

Empty orders do not request from oracle and during settlement they use an invalid oracle version with `price=0` which messes up a lot of fees and funding accounting leading to loss of funds for the makers

Empty orders in the Perennial V2 market do not request an oracle version, so during settlement they use an invalid oracle version with price zero. This causes fees and funding to be calculated as zero for any period without non-empty orders, leading to a loss of funds for makers.

Perennial V2 Update #2

High
Business logic

Makers can lose funds from price movement even when no long and short positions are opened, due to incorrect distribution of adiabatic fees exposure between makers

The adiabatic fee mechanism in Perennial v2.3 incorrectly distributes fee exposure among makers based on position size rather than individual exposure, causing individual makers to gain or lose funds from price movements even when no long or short positions are open. An attacker could exploit this to cause other makers to lose up to several percent of their notional value.

Perennial V2 Update #2

Medium
Business logic

_loadContext() uses the wrong pendingGlobal

The strategy library loaded the per-account pending order instead of the market-wide pending order when computing the current, minimum and maximum position. This made those position values wrong and could cause the rebalance logic to compute incorrect targets in rare edge cases.

Perennial V2 Update #2

Medium
Business logic

Liquidator can set up referrals for other users

A liquidator could set a referrer for a user during liquidation, and because the referrer is carried over to future order versions, the user could never change it. This prevented the user from setting their own referrer later.

Perennial V2 Update #2

Medium
Business logic

If referral or liquidator is the same address as the account, then liquidation/referral fees will be lost due to local storage being overwritten after the `claimable` amount is credited to liquidator or referral

During settlement, liquidation and referral fees are credited to the account's local storage, but if the liquidator or referrer is the same as the account being settled, the in-memory copy of the account's local data overwrites those credits, causing the fees to be lost. An attacker could self-liquidate or self-refer and lose the fees, which remain stuck in the contract.

Perennial V2 Update #2

Medium
Business logic

All transactions to claim assets from the vault will revert in some situations due to double subtraction of the claimed assets in market position allocations calculation

A double subtraction of the claimed amount in the vault's market position allocation calculation causes the calculated assets to be lower than the minimum required, leading to a revert when users try to claim redeemed assets. This can temporarily or permanently lock user funds if a market's skew prevents further redemptions.

Perennial V2 Update #2

Medium