Hunt prep
Before you test Perennial V2 Update #1
What 58 disclosed reports say about Perennial V2 Update #1: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing 15
Ideas drawn from this program's disclosed reports and our class lessons. None of them is a known bug: each is a place to look, and the reports linked under it are why. Check the current scope before testing anything.
-
1
Recheck uint40 truncation on other stored fee and amount fields
Business logic Read the lesson
The interface fee truncation shows the codebase stores validated values in narrower types than it checks. Audit every fee, magnitude and amount that is validated against one width and cast to a smaller one, especially in the market and vault fee paths, and test boundary values just above the storage maximum.
From the lessons: Solidity lending and commitment pool contracts with maturity borrows,...
-
2
Compare MultiInvoker closable logic against Market across all paths
Business logic Read the lesson
Several reports show MultiInvoker's closable amount diverging from Market's for pending, invalid and current oracle versions. Build a matrix of position states (settled, pending, invalidated, zeroed) and compare the two implementations for each, since the same copy divergence keeps recurring.
Backed byMultiInvoker closableAmount the calculation logic is wrong (2023) `MultiInvoker._latest` calculates incorrect closable for the cur... (2023) MultiInvoker liquidation action will revert due to incorrect clo... (2023)From the lessons: The liquidation routine that seizes collateral, deducts a liquidator f...
-
3
Test settlement fee charging for retired and zero weight markets
Business logic Read the lesson
The vault charges settlement fees for markets whose weight is zero and cannot remove them. Check whether other per-market loops (rebalancing, reward claiming, asset accounting) also iterate retired markets and whether a zero weight market can still affect user claims.
Backed bySettlement fee of unused markets is still charged in Vault (2023) vault.claimReward() If have a market without reward token, it ma... (2023)From the lessons: ERC-4626 style vaults with period-based withdrawal buckets, blocklist...
-
4
Probe vault collateral accounting for excluded pending fees
Business logic Read the lesson
The vault collateral calculation omits pending keeper and position fees that the market includes. Test other vault views and health checks (max redeem, max deposit, epoch asset snapshots) for the same omission, since a mismatch between vault and market accounting appears repeatedly.
Backed byPending keeper and position fees are not accounted for in vault... (2023) Vault leverage can be increased to any value up to min margin re... (2023) Vault max redeem calculations limit redeem amount to the smalles... (2023)From the lessons: Junior LP redemption and deposit pricing at epoch boundaries.; Recapitalisation, reconcile and high-water mark logic for Senior and J...
-
5
Recheck deposit cap arithmetic with claimable and pending assets
Business logic Read the lesson
The max deposit calculation added claimable assets instead of subtracting them. Exercise the cap with combinations of unclaimed redemptions, pending deposits and multiple users in the same epoch to see whether other cap or limit formulas mix claimable and collateral amounts.
From the lessons: ERC-4626 style vaults with period-based withdrawal buckets, blocklist...
-
6
Test keeper and oracle loops for single-market revert propagation
Business logic Read the lesson
KeeperOracle commit reverts for all markets when one market update fails, and request records only the first market per version. Check other batch loops over markets and callbacks (settle, update, reward claim) for the same lack of per-item error handling or early return placement.
Backed by`KeeperOracle.commit` will revert and won't work for all markets... (2023) `KeeperOracle.request` adds only the first pair of market+accoun... (2023)From the lessons: Cross-chain operator contracts with job execution, bonding and gas che...
-
7
Exercise invalid oracle version handling across market and vault
Business logic Read the lesson
Invalid oracle versions repeatedly cause position limit bypass, global and local desync, and vault over-sizing. Test every path that settles or invalidates pending positions (maker limit checks, vault strategy sizing, liquidation) with an invalid version to find further places that skip adjustment or limit checks.
Backed byInvalid oracle version can cause the `maker` position to exceed... (2023) Invalid oracle version can cause the vault to open too large and... (2023) Invalid oracle versions can cause desync of global and local pos... (2023)From the lessons: Leveraged lending positions, Uniswap strategy tick ranges, fee collect...
-
8
Check self-liquidation and margin invariant bypass variants
Business logic Read the lesson
Reports show positions can be opened and self-liquidated in one transaction to bypass efficiency and liquidity limits, and that close paths skip the maintenance invariant. Test other order types and modifiers (taker invariant, utilisation buffer, close paths) for the same gap between open and close enforcement.
Backed byIt is possible to open and liquidate your own position in 1 tran... (2023) It is possible to open and liquidate your own position in 1 tran... (2023) User would liquidate his account to sidestep `takerInvariant` mo... (2023)From the lessons: Open and close virtual price impact charges and rebates, including ref...; Virtual price impact charged on skew-increasing opens and refunded as...
-
9
Test liquidation position direction and fee accounting invariants
Business logic Read the lesson
Liquidators could increase positions because only closable zero was checked, and fee calculation used stale collateral. Test liquidation paths for missing direction checks, fee underflow and stale balance reads, including bad debt socialisation and negative collateral outcomes.
Backed byLiquidator can liquidate user while increasing user position to... (2023) Accounts will not be liquidated when they are meant to (2023) Bad debt (shortfall) liquidation leaves liquidated user in a neg... (2023)From the lessons: The liquidation routine that seizes collateral, deducts a liquidator f...
-
10
Probe keeper fee payment paths for empty or zero input abuse
Business logic Read the lesson
KeeperFactory settle paid a fee for empty arrays, and vault update with zero amounts inflated checkpoint counts. Test every keep modifier and fee-paying entry point with empty, zero and repeated calls to see whether fees are paid without work or shared unfairly.
Backed byAttacker can call `KeeperFactory#settle` with empty arrays as in... (2023) `Vault.update(anyUser,0,0,0)` can be called for free to increase... (2023)From the lessons: Cross-chain operator contracts with job execution, bonding and gas che...
-
11
Recheck oracle commit ordering and timestamp checks across providers
Business logic Read the lesson
Pyth commit lacked the publish timestamp ordering check that commitRequested has, and commitRequested could be front-run. Test the Chainlink and other provider adapters for the same missing ordering or staleness checks, and check provider switch paths for stuck states.
Backed byPythOracle `commit()` function doesn't require (nor stores) pyth... (2023) commitRequested() front-run malicious invalid oralce (2023) During oracle provider switch, if it is impossible to commit the... (2023)+2 more reports
- During oracle provider switch, if previous provider feed stops working completely, oracle and market will be stuck with user funds locked in the contract (2023)
- `OracleVersion latestVersion` of `Oracle.status()` may go backwards when updating to a new oracle provider and result in wrong settlement in `_processPositionLocal()` (2023)
From the lessons: Batch order execution reusing a cached price basket, including across...; Frozen-market liquidation and voluntary close paths during the weekend...
-
12
Test oracle price exponent and rounding handling
Business logic Read the lesson
Negative exponents were mishandled and rounding in vault share maths allowed first-depositor manipulation. Check other price conversion and share calculation paths for sign handling and rounding direction, especially where small deposits or donations change exchange rates.
Backed byPythOracle:if price.expo is less than 0, wrong prices will be re... (2023) BalancedVault.sol: Early depositor can manipulate exchange rate... (2023)From the lessons: Junior LP redemption and deposit pricing at epoch boundaries.
-
13
Probe access control on settle, claim and factory update functions
Access control Read the lesson
Settling the zero address disrupted accounting, claim could be forced on another account, and factory update had wrong privilege checks. Test permissionless functions that take an account or address parameter for missing ownership checks and zero address handling.
-
14
Test vault redeem and claim under market failure and zero values
Business logic Read the lesson
Redeem reverts when one market fails and claim can underflow when epoch assets are zero. Test emergency and edge paths (zero price payoff, zero amount positions, failed market) for reverts that lock funds, and check whether any bypass exists.
Backed by`BalancedVault` doesn't consider potential break in one of the m... (2023) BalancedVault.sol: claim can be impossible due to unsigned integ... (2023) Payoff definitions that can cross zero price are not supported (2023)+1 more report
From the lessons: ERC-4626 style vaults with period-based withdrawal buckets, blocklist...
-
15
Check rebalancing fee accounting and settlement flywheel sync
Business logic Read the lesson
Repeated rebalancing with asymmetric maker fees drains the vault, and user and global settlement flywheels can desync. Test rebalance and settlement ordering across epochs, including small deposits that push pending epochs, for fee leakage and share misallocation.
Backed byIf long and short products has different maker fees, vault rebal... (2023) BalancedVault.sol: loss of funds + global settlement flywheel /... (2023) Unintended Vault Operation Due to Product Settling and Oracle Ve... (2023)From the lessons: Junior LP redemption and deposit pricing at epoch boundaries.; Recapitalisation, reconcile and high-water mark logic for Senior and J...
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 45 | 0 | – | – | $0 |
| DoS lesson | 9 | 0 | – | – | $0 |
| Access control lesson | 1 | 0 | – | – | $0 |
| Smart contracts lesson | 1 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
`KeeperOracle.commit` will revert and won't work for all markets if any single `Market` is paused
The report recommends wrapping the market update call in a try-catch to ignore reverts, or limiting the number of markets in the callback queue.
Disclosed
-
It is possible to open and liquidate your own position in 1 transaction to overcome efficiency and liquidity removal limits at almost no cost
The fix was to use the maintained amount only for liquidation, while all account changes perform the margined check, making it impossible to change position and self-liquidate in one transaction.
Disclosed
-
MultiInvoker doesn't pay keepers refund for l1 calldata
The issue was fixed by implementing chain-specific versions of MultiInvoker that correctly calculate the calldata fee.
Disclosed
-
Liquidator can liquidate user while increasing user position to any value, stealing all Market funds or bricking the contract
The fix was to add a check that the liquidator's order must decrease the position.
Disclosed
-
Invalid oracle version can cause the `maker` position to exceed `makerLimit`, temporarily or permanently bricking the Market contract
The invariant bricking issue was fixed by only reverting orders that increase maker when over the limit, but the incorrect maximum maker limit issue was acknowledged and not fixed.
Disclosed
-
Pending keeper and position fees are not accounted for in vault collateral calculation which can be abused to liquidate vault when it's small
The vault should subtract pending fees when loading underlying market data for collateral calculations; the report states this was fixed.
Disclosed
-
Vault leverage can be increased to any value up to min margin requirement due to incorrect `maxRedeem` calculations with closable and `LEVERAGE_BUFFER`
The fix should calculate the target position after subtracting the closable amount, then compute the target collateral using the leverage multiplied by LEVERAGE_BUFFER, and set maxRedeem as the difference between current collateral and target collateral.
Disclosed
-
Settlement fee of unused markets is still charged in Vault
The maintainer declined to fix it at this time, noting that skipping settlement for zero-weight markets would require material refactors.
Disclosed
-
`KeeperOracle.request` adds only the first pair of market+account addresses per oracle version to callback list, ignoring all the subsequent ones
The addition to the callback list should be moved before the early return condition, so every request is recorded.
Disclosed
-
Vault max redeem calculations limit redeem amount to the smallest position size in underlying markets which can lead to very small max redeem amount even with huge TVL vault
The issue was fixed by changing the max redeem logic to compare target and current positions and collateral, with a follow-up fix to correctly handle cases where the position can be fully closed.
Disclosed
-
Attacker can call `KeeperFactory#settle` with empty arrays as input parameters to steal all keeper fees
The function was fixed by reverting when the ids array length is zero.
Disclosed
-
Vault `_maxDeposit` incorrect calculation allows to bypass vault deposit cap
The _maxDeposit function should be corrected to subtract claimable assets from collateral, as shown in the recommendation.
Disclosed
-
MultiInvoker closableAmount the calculation logic is wrong
The issue was fixed as a side effect of deprecating the Liquidate action from MultiInvoker, making the calculation unnecessary.
Disclosed
-
`MultiInvoker._latest` will return `latestPrice = 0` when latest oracle version is invalid causing liquidation to send 0 fee to liquidator or incorrect order execution
The issue was fixed by removing liquidation from MultiInvoker and preventing order execution for invalid oracle versions.
Disclosed
-
commitRequested() front-run malicious invalid oralce
The commit function should check whether the supplied price is actually valid for the next requested version and reject it if so, so it cannot be used to advance the timestamp ahead of commitRequested.
Disclosed