AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 29 Bitcoin

blockstorage: allow reading partial block data from storage

Public commit record

What the developer wrote

Authored by Roman Zeyde

93/100 · Strong
blockstorage: allow reading partial block data from storage

It will allow fetching specific transactions using an external index,
following https://github.com/bitcoin/bitcoin/pull/32541#issuecomment-3267485313.

No logging takes place in case of an invalid offset/size (to avoid spamming the log),
by using a new `ReadRawError::BadPartRange` error variant.

Co-authored-by: Hodlinator <172445034+hodlinator@users.noreply.github.com>
Co-authored-by: Lőrinc <pap.lorinc@gmail.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit adds a new feature to Bitcoin Core that lets the node read only a slice of a stored block (a specific byte range) instead of the whole block. It is meant to support future REST API improvements for fetching specific transactions. The commit includes careful range checks and avoids logging invalid requests to prevent log spam. There is no direct evidence in the commit that this fixes an active security bug, but it does touch untrusted REST input handling, so defensive care is warranted.

Recommended action

Review the REST endpoint wiring that will eventually consume this new parameter to ensure the offset/size are parsed safely and that BadPartRange results in an appropriate HTTP error rather than silent behavior. Verify that the size_t arithmetic cannot wrap on unusual platforms and that the seek+read path does not leak block size information via timing.

Security signals we found

01

New untrusted input path: REST block-part offset/size reaches block storage layer

02

Explicit no-logging decision to avoid log spam from untrusted REST input

03

Range validation added before seek/read: size==0, offset>=blk_size, size>blk_size-offset rejected

04

New error enum variant BadPartRange for invalid partial-block requests

05

REST handler switch falls through silently on BadPartRange (no error response)

06

Unit tests exercise boundary and overflow-like ranges

Risk score

Why this scored 29/100

Our methodology →
Potential impact 5/30
Exploitability 5/25
Stealth signal 5/15
Affected reach 5/15
Confidence 6/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.