Skip to content
DoS Write-up Advanced

Perennial

A bug in how Perennial tracked Chainlink phase changes caused its version-to-round mapping to become incorrect after a second phase shift, making the protocol's settlement calls revert for an extended period. An attacker could not steal funds, but the protocol could be frozen for roughly two years until Chainlink caught up.

mirror.xyz

Published on mirror.xyz

Perennial is a derivatives primitive that allows for the creation of two-sided markets that trade exposure to an underlying price feed. In other words, each epoch, Chainlink price feeds are used to determine the winning side of the market, and transfer assets from one side to the other.

The author, on mirror.xyz

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the code pushed the round count within the current phase onto the starting-version array instead of the cumulative total number of rounds across all phases, so after a second phase change the stored starting version was too low.

Impact

The protocol's settlement and syncing would revert, locking all products for approximately two years until Chainlink reached the requested round; no theft or incorrect price was possible.

What the attacker needed

Chainlink feed undergoes a second phase change; Protocol has enough history for the gap to be long

The fix

The code should add the cumulative total number of rounds across all phases, not just the round count within the latest phase, when extending the starting-version array.

How it was found

  1. Chainlink updates the phase ID of a feed, and the code adds the round count to the starting-version array.
  2. Later, Chainlink updates the phase ID again, and the code adds only the round count from the recent phase, producing an array with a too-small final value.
  3. At the next settlement, the product calls the oracle with the latest version, which triggers the version-to-round conversion.
  4. The conversion subtracts the too-small starting version, producing a round ID far in the future.
  5. The call to Chainlink's registry reverts with an invalid round error, and settlement remains blocked until that future round is reached.

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 write-up has not been written yet. The Original tab links to the source.

Chainlink is a service that provides price data in numbered rounds, and occasionally it switches to a new internal phase, which changes how those round numbers look. Perennial tried to translate those round numbers into its own simple version numbers, but it made a mistake when a second phase switch happened. The result was that the protocol asked for a round far in the future, which did not exist yet, so its normal update function kept failing and the market could not move forward.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.