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

scratch: reject sizes that overflow when added to header

Public commit record

What the developer wrote

Authored by Sebastian Falbesoner

86/100 · Strong
scratch: reject sizes that overflow when added to header

We only use scratch space internally, so this is not an issue for the
user (scratch API functions have been removed since 0.6.0), but fixing
this might still make sense to prepare for the unlikely case that we
expose the scratch API again in the future. An alternative could be
to simply delete the scratch space functionality already, as e.g. done
in PR #1789.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a low-level arithmetic overflow check in a special internal memory-pool helper called 'scratch space'. Because the scratch API is no longer exposed to users, the bug cannot be triggered by normal callers today. The change adds a guard so that an impossibly large requested size does not silently wrap around and produce a smaller memory allocation than intended.

Recommended action

No urgent action is required for end users because the scratch API is internal-only. Downstream integrators should update to a version containing this commit as part of routine maintenance, especially if they maintain a fork that still exposes scratch-space functions.

Security signals we found

01

Integer overflow in size calculation

02

Potential heap buffer under-allocation

03

Defensive hardening of internal allocator helper

04

API no longer public, reducing practical exposure

Risk score

Why this scored 23/100

Our methodology →
Potential impact 4/30
Exploitability 2/25
Stealth signal 3/15
Affected reach 2/15
Confidence 8/10
Evidence quality 4/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.