Skip to content
Business logic Audit finding Intermediate

requestId has no unique parameters leading to different collisions

The requestId derived from request parameters lacks a nonce or sender address, so identical requests collide and cannot be resubmitted. An attacker can front-run a victim's transaction with the same parameters, causing the victim's request to revert and blocking data retrieval.

0xeix Follow with Boy2000, PNS and 4 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-12-seda-protocol-judging/issues/212

Found by

0xeix, Boy2000, PNS, blutorque, leopoldflint, rsam_eth, zxriptor

Summary

The requestId parameter that's derived when posting a request is not unique and therefore can't be replicated again if needed or can be blocked by other users with front-running.

Root Cause

Currently, the requestId that's obtained by calling deriveRequestId() cannot be sent again with the same parameters if needed (for instance, when dealing with data price feeds) and can be blocked as well leading to undesired behavior for the entity that tries to post it.

Internal Pre-conditions

External Pre-conditions

An entity posts a data request on one of the supported chains.

Attack Path

  1. There can be a situation where the same data request with exactly the same input parameters is needed to be sent (when dealing with price feeds for example) but it can't be done as the one of the parameters is needed to be adjusted each time

  2. Users who are interested in blocking a data request can infinetely front-run the transactions and block the data request posting (this could lead to a situation where some users benefit from the stale prices used in some other protocol that can't fetch the data)

Impact

Data request collisions open up many attack surfaces including the situation where protocols can't fetch the data if an attacker decides to front-run them each time and blocking the requests (if there is a data request with the same id, the tx will revert)

PoC

Consider the current requestId derivation process:

https://github.com/sherlock-audit/2024-12-seda-protocol/blob/main/seda-evm-contracts/contracts/libraries/SedaDataTypes.sol#L122-139

SOLLIDITY

   function deriveRequestId(RequestInputs memory inputs) internal pure returns (bytes32) {
        return
            keccak256(
                bytes.concat(
                    keccak256(bytes(SedaDataTypes.VERSION)),
                    inputs.execProgramId,
                    keccak256(inputs.execInputs),
                    bytes8(inputs.execGasLimit),
                    inputs.tallyProgramId,
                    keccak256(inputs.tallyInputs),
                    bytes8(inputs.tallyGasLimit),
                    bytes2(inputs.replicationFactor),
                    keccak256(inputs.consensusFilter),
                    bytes16(inputs.gasPrice),
                    keccak256(inputs.memo)
                )
            );
    }

So the requestId depends on each of this parameters. And if the same one already exists, the new request with the same params will be blocked:

https://github.com/sherlock-audit/2024-12-seda-protocol/blob/main/seda-evm-contracts/contracts/core/abstract/RequestHandlerBase.sol#L42-44

Solidity

     if (bytes(_requestHandlerStorage().requests[requestId].version).length != 0) {
            revert RequestAlreadyExists(requestId);
        }

First of all, there is no any nonce parameter in the requestId meaning the entity that posts a request has to always change them to make a new hash which damages user experience. The most serious impact though is an ability of malicious users to front-run the requests and always create a request with the same values as there is no msg.sender involved here. This leads to a situation where blockchains or users can't even post a request and this can be essential to the protocol if it depends on the external oracles and the data can't be fetched in time leading to stale state.

Mitigation

Introduce some unique parameters like nonce and msg.sender address.

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/sedaprotocol/seda-evm-contracts/pull/97/files

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

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 requestId is computed solely from request parameters without including a nonce or the sender's address, making it deterministic and predictable.

Impact

An attacker could repeatedly front-run requests to block them, potentially causing protocols to use stale prices if they rely on timely data.

What the attacker needed

Attacker can front-run transactions; victim posts a data request

The fix

The protocol team fixed this issue by introducing unique parameters such as a nonce and the sender's address into the requestId derivation.

How it was found

  1. An entity posts a data request on a supported chain.
  2. An attacker observes the request parameters and front-runs with an identical request.
  3. The victim's transaction reverts because the requestId already exists.

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.

When you send a request to a blockchain, it gets a unique identifier based on its details. If two requests have exactly the same details, they get the same identifier, and the second one is rejected. An attacker can copy your request details and send them first, so your request is rejected and you cannot get your data.

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 0xeix

View all

10 more disclosed reports, best first.

More from SEDA Protocol

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.