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

http: Implement HTTPRequest class

Public commit record

What the developer wrote

Authored by Matthew Zipkin

66/100 · Adequate
http: Implement HTTPRequest class

HTTP Request message:
https://datatracker.ietf.org/doc/html/rfc1945#section-5

Request Line aka Control Line aka first line:
https://datatracker.ietf.org/doc/html/rfc1945#section-5.1

See message_read_status() in libevent http.c for how
`MORE_DATA_EXPECTED` is handled there
✓ Descriptive subject✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit introduces a new HTTP request parser for Bitcoin Core's internal web server. It is a defensive, by-the-book implementation that explicitly rejects malformed request lines, bad HTTP versions, NUL bytes, conflicting Content-Length headers, oversized bodies, and non-numeric content lengths. The code is accompanied by extensive unit tests demonstrating these protections. There is no indication in the commit or supplied references that this fixes a known vulnerability; it appears to be a refactoring or hardening change.

Recommended action

No immediate action required. Treat as routine hardening/refactoring. Reviewers may want to confirm the new parser is fully wired into request handling and that downstream callers correctly map `ContentTooLargeError` to HTTP 413 and other parse errors to HTTP 400, but that is outside the scope of this commit.

Security signals we found

01

New HTTP request parser with strict validation of request line, version, headers, and body

02

Explicit rejection of NUL bytes in request line to prevent C-string parser truncation issues

03

Strict HTTP version enforcement (major must be 1, minor 0-9, exactly one digit each)

04

Duplicate Content-Length header consistency check

05

Content-Length limited to 32 MiB with dedicated ContentTooLargeError exception

06

Extensive unit tests for malformed inputs and edge cases

Risk score

Why this scored 28/100

Our methodology →
Potential impact 5/30
Exploitability 5/25
Stealth signal 5/15
Affected reach 5/15
Confidence 5/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.