Skip to content
Race condition Audit finding Intermediate

Gas price spikes cause the selected operator to be vulnerable to frontrunning and be slashed

The Holograph operator selection mechanism allows other operators to front-run the selected operator during a gas price spike by submitting a transaction with a higher gas price, causing the selected operator to be slashed. An attacker could profit from the slashed reward.

Chom Follow

Originally disclosed on Code4rena

Submitted by Chom, also found by Lambda and Trust

HolographOperator.sol#L354

require(gasPrice >= tx.gasprice, "HOLOGRAPH: gas spike detected");
        /**
         * @dev select operator that failed to do the job, is slashed the pod base fee
         */
        _bondedAmounts[job.operator] -= amount;
        /**
         * @dev the slashed amount is sent to current operator
         */
        _bondedAmounts[msg.sender] += amount;

Since you have designed a mechanism to prevent other operators to slash the operator due to “the selected missed the time slot due to a gas spike”. It can induce that operators won’t perform their job if a gas price spike happens due to negative profit.

But your designed mechanism has a vulnerability. Other operators can submit their transaction to the mempool and queue it using gasPrice in bridgeInRequestPayload. It may get executed before the selected operator as the selected operator is waiting for the gas price to drop but doesn’t submit any transaction yet. If it doesn’t, these operators lose a little gas fee. But a slashed reward may be greater than the risk of losing a little gas fee.

require(timeDifference > 0, "HOLOGRAPH: operator has time");

Once 1 epoch has passed, selected operator is vulnerable to slashing and frontrunning.

Recommended Mitigation Steps

Modify your operator node software to queue transactions immediately with gasPrice in bridgeInRequestPayload if a gas price spike happened. Or allow gas fee loss tradeoff to prevent being slashed.

alexanderattar (Holograph) confirmed and commented:

Valid, we have not fully finalized this mechanism and will consider mitigation strategies.

gzeon (judge) increased severity to High and commented:

High risk because potential slashing.


The original report as published on Code4rena, by Chom. 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

Impact

The selected operator could be slashed and lose their bonded amount, while the front-running operator gains the slashed reward.

What the attacker needed

Gas price spike occurs; selected operator delays transaction; attacker is another operator

The fix

The operator node software should queue transactions immediately with the gas price from the bridge request if a gas spike happens, or allow a gas fee loss tradeoff to prevent slashing.

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 system, operators are supposed to process jobs. If the selected operator is slow because gas prices are high, another operator can jump in and take the job, and the original operator gets punished (slashed). This means someone can deliberately wait for a gas spike to steal the reward.

What is Race condition?

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.

More by Chom

View all

13 more disclosed reports, best first.

More from Holograph contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.