Skip to content
Business logic Audit finding Advanced

The LPP challenge period can cause malicious and freeloader claims to be uncounterable and can also cause freeloader claims to be abused to entrap honest challengers

The LPP challenge period can cause malicious and freeloader claims to be uncounterable, and freeloader claims can be abused to entrap honest challengers, leading to stolen bonds. An attacker could force an honest challenger to inherit a clock smaller than the challenge period, making it impossible to counter a freeloader claim at MAX_GAME_DEPTH and steal the honest party's bond.

RadiantLabs Follow with Zubat and alexfilippov314

Originally disclosed on Code4rena

Submitted by RadiantLabs, also found by Zubat and alexfilippov314

In some cases, the honest challenger must pass an LPP in order to counter a MAX_GAME_DEPTH claim through step(). For instance, “in the event that the preimage is too large to be submitted through calldata in a single block, challengers must resort to the streaming option” as described in the Optimism specs.

However, an issue arises because to pass an LPP, the honest challenger must wait for CHALLENGE_PERIOD seconds in order to pass the LPP to be able to step() against a malicious MAX_GAME_DEPTH claim. The honest challenger will have a minimum of one CLOCK_EXTENSION (3 hours on mainnet) period on their chess clock, which cannot cover the CHALLENGE_PERIOD for an LPP (1 day on mainnet).

There are essentially 3 impacts that this can cause:

Impact 1: A malicious MAX_GAME_DEPTH claim can be uncounterable if honest challenger does not have time left.

If the honest challenger has less than 1 day left in their chess clock when reaching the malicious claim at MAX_GAME_DEPTH, they cannot possibly pass an LPP in time. This will cause the malicious claim to be uncountered while the honest challenger’s claim will be countered leading to an incorrect game result.

Impact 2: Uncounterable freeloader claims can be made by forcing an honest challenger to inherit a clock smaller than CHALLENGE_PERIOD.

The CLOCK_EXTENSION is a feature meant for honest challengers to counter a freeloader claim, a freeloader claim is described as follows:

Consider an attacker claim denoted by A in the subtree below. Suppose that this claim is valid, then the correct move for the honest party is to defend the claim. The honest party’s claim is denoted by claim H.

   A
 /   \
F     H

To prevent themselves from losing the bond, suppose the attacker then attacks claim A with the claim F. Due to the leftmost priority, they would receive the bond if their freeloader claim F remains uncountered. This is possible if the attacker’s chess clock has very little time left because the honest party needs to use the attacker’s chess clock to counter the freeloader claim.

To resolve this, Optimism uses clock extensions, where if a chess clock has less than CLOCK_EXTENSION seconds left, it is extended to CLOCK_EXTENSION seconds.

If the honest challenger must pass an LPP to counter the freeloader claim at MAX_GAME_DEPTH via step() it will not have enough time to do so, resulting in the freeloader claim stealing the bond from the honest party’s claim.

Impact 3: Freeloader claims can now be used to bait honest challengers to respond and then entrap them, winning all the bonds they used to counter the freeloader claim.

Combining the points raised in both impacts earlier, we can now see how freeloader claims can be used as bait to steal all the bonds used to counter the freeloader claim. The key point here is that when the honest challenger counters a freeloader claim, they essentially “swap” chess clocks with the attacker. All further moves made by the honest challenger now use the attacker’s chess clock which can be manipulated to CLOCK_EXTENSION earlier. Now, let’s take a look at the following scenario:

   A
 /   \
F1    H1
|
H2
|
F2

Here, the attacker has responded to the honest user’s claim H2, with their new claim F2. To counter F2, the honest challenger will still be using the attacker’s chess clock which will be manipulated to CLOCK_EXTENSION time. Let’s suppose F2 is a claim at MAX_GAME_DEPTH and to counter it the honest challenger must pass an LPP, as elaborated earlier they won’t be able to do so and they essentially cannot counter F2. But now, they also will have their bonds for posting H2 stolen from them, as F2 will now counter H2. Furthermore, the freeloader claim F1 will still steal the bond from A using the leftmost priority.

Therefore, this technique can be used attackers to entrap honest challengers, by purposefully posting an invalid state that has a valid state preceding it that requires a max size LPP to execute step() on, they can further steal bonds away from the honest challengers to counter the freeloader claim.

Recommended Mitigation Steps

Apply a bigger extension such as CHALLENGE_PERIOD + CLOCK_EXTENSION at the MAX_GAME_DEPTH - 1 claim, as shown below.

+       IPreimageOracle oracle = VM.oracle();
+       if (nextPositionDepth == MAX_GAME_DEPTH - 1 && nextDuration.raw() > MAX_CLOCK_DURATION.raw() - oracle.challengePeriod() - CLOCK_EXTENSION.raw()) {
+           // Apply 1 CHALLENGE_PERIOD + 1 CLOCK_EXTENSION here.
+           nextDuration = Duration.wrap(MAX_CLOCK_DURATION.raw() - oracle.challengePeriod() - CLOCK_EXTENSION.raw());
+       }
+       else if (nextDuration.raw() > MAX_CLOCK_DURATION.raw() - CLOCK_EXTENSION.raw()) {
-       if (nextDuration.raw() > MAX_CLOCK_DURATION.raw() - CLOCK_EXTENSION.raw()) {
            // If the potential grandchild is an execution trace bisection root, double the clock extension.
            uint64 extensionPeriod =
                nextPositionDepth == SPLIT_DEPTH - 1 ? CLOCK_EXTENSION.raw() * 2 : CLOCK_EXTENSION.raw();
            nextDuration = Duration.wrap(MAX_CLOCK_DURATION.raw() - extensionPeriod);
        }

This will solve all of the scenarios above.

ajsutton (Optimism) confirmed and commented:

Impact 1 is invalid - the honest actor should be responding reasonably quickly and is expected to still have sufficient time on the clock to allow for the large preimage proposal time.

However, the impact of this on freeloader claims and the clock extension being insufficient in the case of large preimages being required is valid and something we will need to fix.

obront (judge) decreased severity to Medium and commented:

This issue is valid, but given the clarification from the sponsor that Impact 1 is invalid, I believe it’s likely that a Medium severity is more appropriate (i.e., worst case does not allow spoofing invalid state, only stealing some bonds).

I’ll also need to consider whether the dups are valid as dups (or should receive partial credit), as this report was the most clear on the other implications.

The other reports do identify the freeloader claims, which is the core issue. I will downgrade to Medium and leave the dups as-is receiving full credit.

haxatron (warden) commented:

@obront, we believe high is more appropriate for this finding. From impact 3 about entrapping the honest challenger, we note the loss of funds of the honest challenger which is very different from the loss of incentive. Here, “loss of funds” refers the funds lost by the honest challenger when posting their bonds and getting them stolen by the attacker and “loss of incentive” refers to the bonds entitled by the honest challenger for correctly countering the adversary claim.

Furthermore, the loss of fund impact is high, if we look at our example in impact 3, the honest challenger will post the bond H2 and lose their bond H2, which as MAX_GAME_DEPTH - 1 comes down to 270_000_000 * 200 gwei = 54 ETH which is by no means a small amount. This loss is also cumulative, as the honest challenger will lose all their bonds they posted to counter the freeloader claim all the way down to MAX_GAME_DEPTH.

All in all, the “loss of funds” impact to the honest challenger is high, so we also believe this should be a high.

EV_om (warden) commented:

@obront Issue #26, on the other hand, only points out impact 2 in this finding. The main difference between impacts 2 and 3 is:

  • Impact 2 only relates to uncounterable freeloader claims at depth MAX_GAME_DEPTH. These claims will have the effect of the attacker being able to reclaim their own bond from the parent claim, instead of it being paid out to the honest challenger for countering it. This represents a loss of incentives for honest challengers.
  • Impact 3 relates to uncounterable freeloader claims at lower depths, and has the effect of all bonds posted by honest challengers from a freeloader claim at any depth all the way down to MAX_GAME_DEPTH being paid out to the attacker. This represents a loss of funds for honest challengers.

Because #26 only points out impact 2 and not the higher impact 3, partial credit would seem fair.

obront (judge) increased severity to High and commented:

After much consideration, I’m in agreement with @haxatron and @EV_om here on all counts.

  1. For consistency in judging, the other issues deemed High either allowed the VM to act in a way that would allow incorrect output roots to be proven, or would allow valid claims to be challenged in a predictable way to allow intentionally stealing a large amount of bonds. This falls into the latter category, so will be upgraded to High.
  2. Issue #26 does capture the root cause here, and gets most of the way there, but on its own would be judged as a Medium because it doesn’t show how bonds could be stolen. I will be moving to partial credit, but because so much of the exploit was understood, I will award 75%.

Note: For full discussion, see here.


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

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

Root cause

Likely the clock extension is shorter than the LPP challenge period, so when an honest challenger must pass an LPP to counter a claim at MAX_GAME_DEPTH, they cannot do so within the extended time.

Impact

An attacker could steal bonds from honest challengers by making freeloader claims uncounterable, and could entrap honest challengers into posting bonds that are then stolen; the sponsor confirmed the freeloader claim issue is valid, though Impact 1 was disputed.

What the attacker needed

Attacker can post claims; honest challenger must respond; large preimage proposal required

The fix

The clock extension at MAX_GAME_DEPTH - 1 should be increased to CHALLENGE_PERIOD + CLOCK_EXTENSION, as recommended.

How it was found

  1. Attacker posts a valid claim A and then a freeloader claim F as a child of A.
  2. Honest challenger posts claim H to defend A, but attacker attacks A with F, forcing the honest challenger to counter F.
  3. To counter F, the honest challenger must pass an LPP, which requires waiting for the challenge period.
  4. The honest challenger's clock is extended only to CLOCK_EXTENSION, which is less than the challenge period, so they cannot pass the LPP in time.
  5. The freeloader claim F remains uncountered and steals the bond from A, and further claims like F2 can steal bonds from H2.

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.

In this dispute game, players have a chess clock that limits how long they have to respond. If a player needs to submit a large piece of data (a large preimage proposal, or LPP), they must wait for a challenge period (one day) before they can use it to make a move. The bug is that the clock extension (three hours) is shorter than that challenge period, so an attacker can leave the honest player with too little time to wait for the LPP and then make the required move, causing the honest player to lose their bond.

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 RadiantLabs

View all

17 more disclosed reports, best first.

More from Optimism Superchain

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.