Skip to content
DoS Audit finding Intermediate

A request poster can set gas_price to 1 and pay minimal fees for a lot of gas and drain validators' resources

The SEDA Core contract's post_request function does not enforce a minimum gas_price, allowing a poster to set it to 1 and pay minimal fees for a large gas limit. A malicious validator can then commit-reveal a result, causing the Tally module to execute a resource-intensive program that inflates memory usage and may delay or halt the chain.

g Follow

Originally disclosed on Sherlock

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

Found by

g

Summary

Due to a lack of validation on gas_price, anyone can post a request to the SEDA Core contract that will consume a lot of resources of validators.

Root Cause

In post_request():9-102, no validations are done on the gas_price and the amount of funds that are required from the poster is just the total gas limit * gas price.

Rust
let required = (Uint128::from(self.posted_dr.exec_gas_limit) + Uint128::from(self.posted_dr.tally_gas_limit))
    .checked_mul(self.posted_dr.gas_price)?;

Since there is no minimum gas_price, the request poster can set it to 1.

Internal Pre-conditions

None

External Pre-conditions

None

Attack Path

  1. A request poster will submit a valid data request with gas_price set to 1, 1 replication factor, tally gas limit set to the max.
  2. A malicious validator commit-reveals a result for this data request and its status changes to "tallying".
  3. In the Tally module's EndBlock(), all "tallying" data requests will be processed. When the malicious data request is processed, it executes the Tally Program with the tally gas limit.
  4. The Tally Program executed can allocate the maximum memory by using imports and loop until the tally gas limit is reached to inflate

memory usage and block execution as long as possible. The inflated memory use lasts as long as the tally program has not exited.

Impact

Inflated resource use on validators running the Tally EndBlock() will cause chain delays or chain halts in the worst case.

PoC

None

Mitigation

Consider requiring a minimum gas_price per data request.

Discussion

sherlock-admin2

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

The original report as published on Sherlock, by g. 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 post_request function lacks a minimum gas_price validation, allowing posters to pay almost nothing for large gas limits.

Impact

Inflated resource use on validators could cause chain delays or chain halts in the worst case.

What the attacker needed

Ability to post a data request; a malicious validator

The fix

The protocol team fixed this issue by requiring a minimum gas_price per data request.

How it was found

  1. Submit a valid data request with gas_price set to 1, replication factor 1, and tally gas limit set to the maximum.
  2. A malicious validator commit-reveals a result for this data request, changing its status to 'tallying'.
  3. The Tally module's EndBlock processes all 'tallying' requests, executing the Tally Program with the specified tally gas limit.
  4. The Tally Program allocates maximum memory and loops until the gas limit is reached, inflating memory usage and blocking execution.

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.

A smart contract lets users post data requests and pay a fee based on gas price times gas limit. Because there is no minimum gas price, someone can set it to the lowest possible value and still request a huge amount of computation. When validators later process that request, they waste a lot of resources, which can slow down or even stop the blockchain.

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.

More by g

View all

23 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.

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.