cl/beacon/handler: block publication reads an unbounded request body

Open
#26,460 1 comment 0 reactions 2 assignees View on GitHub

Maintainers usually reply within 1 day

@domiwei is already working on this.

Since Nov 18, 2026.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go

Research direction

Start with parseRequestBeaconBlock and the blinded block handler in cl/beacon/handler, then compare their request body handling with the aggregate-and-proofs POST handler that uses http.MaxBytesReader. Apply a fork-derived byte limit to both block paths before decoding, and check that oversized full and blinded block requests are rejected without unbounded reads.

Written by the indexing model from the issue text.

Description

Block publication reads the request body with no size bound, so one API request can make the node allocate memory in proportion to the body.

  • Full blocks: parseRequestBeaconBlock runs json.NewDecoder(r.Body).Decode on the raw body.
  • Blinded blocks: io.ReadAll(r.Body) before decoding.
  • Nested attester slashings decode with no index cap until the body sets the fork, so one huge attesting_indices array is fully allocated.
  • Other POST handlers already bound their bodies with http.MaxBytesReader, e.g. aggregate-and-proofs.
  • Direction: a fork-derived byte limit on both paths before decoding.

Found reviewing #26142; present on main.

Dominant language
Go
Stars
3.6k
Forks
1.6k
Avg merge
1d 17h
Merged PRs (30d)
820

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from erigontech/erigon

All issues in erigontech/erigon

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.