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

Add helper methods to HTTPRequest to match original API

Public commit record

What the developer wrote

Authored by Matthew Zipkin

65/100 · Adequate
Add helper methods to HTTPRequest to match original API

These methods are called by http_request_cb() and are present in the
original http_libevent::HTTPRequest.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit adds helper methods to Bitcoin Core's HTTP request handling so that newer internal code can mimic the older libevent-based API. The main functional change is a new, more tolerant URL query-parameter parser. It replaces a strict libevent parser that would throw a runtime error on malformed percent-encoding with a custom parser that keeps going. The commit also adds tests showing the new parser accepts invalid percent signs that the old code rejected. This is mostly a compatibility/refactoring change, but the relaxed parsing could theoretically hide malformed input that downstream code did not expect.

Recommended action

Review callers of GetQueryParameter to confirm they tolerate raw '%' characters and do not assume libevent's strict validation. Consider adding fuzz tests for GetQueryParameterFromUri covering malformed UTF-8, null bytes, oversized query strings, and ambiguous delimiter encodings. Monitor for any downstream REST/JSON-RPC behavior changes caused by the more permissive parser.

Security signals we found

01

Relaxed input validation: malformed percent-encoding no longer raises an error and is returned to callers as raw data.

02

Custom parser replaces mature library parser (libevent), increasing attack surface for URL parsing edge cases.

03

New code uses std::string_view and pointer arithmetic to construct query substrings; bounds appear correct but are now project-maintained.

04

No input sanitization change is advertised as a security fix; commit framing is API compatibility.

Risk score

Why this scored 20/100

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