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

libplugin: json_id: guard against weird prefixes

Public commit record

What the developer wrote

Authored by Lagrang3

68/100 · Adequate
libplugin: json_id: guard against weird prefixes

Following the recent enforcement of ids being printable strings
we put guards on "method" and "prefix" as well.

Changelog-None

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit tightens a safety check in Core Lightning's plugin library. When a plugin sends a JSON-RPC request, it builds an internal ID from a method name and a prefix. The code already replaced the method name with a safe placeholder if it contained unusual characters that would need escaping. Now it does the same for the prefix. If either field had weird characters, the generated ID could be escaped differently than expected, and the plugin might fail to match the reply to the right outgoing request. The patch is a small, defensive hardening change.

Recommended action

Treat as a low-risk hardening fix. Review whether any caller passes a user-controlled or untrusted prefix, and consider whether json_escape_needed() is sufficient to prevent all ID-mismatch edge cases. No urgent action required.

Security signals we found

01

Hardening of request/response correlation ID generation

02

Potential mismatch between outgoing JSON-RPC id and incoming reply id if escaping occurs

03

Defensive validation of plugin-supplied strings before use in protocol identifiers

Risk score

Why this scored 38/100

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