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

lightningd: reject newlines in persistent setconfig values

Public commit record

What the developer wrote

Authored by Sangbida Chaudhuri

73/100 · Adequate
lightningd: reject newlines in persistent setconfig values

Changelog-Fixed: `setconfig` no longer permits config-line injection through persistent option values.

(cherry picked from commit 54178251aafc0ef793ab9a4dd9c44320bd40812d)
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in Core Lightning's `setconfig` RPC command. Previously, a user or attacker who could call `setconfig` could store a configuration value containing newline characters. Because persistent settings are written into a config file line-by-line, those newlines could split one setting into multiple lines, effectively injecting extra configuration directives. The patch now rejects any persistent value containing `\n` or `\r`.

Recommended action

Treat this as a security fix and include it in release notes. Users running affected versions should upgrade and audit persistent config files for unexpected injected lines if they exposed `setconfig` to untrusted callers.

Security signals we found

01

config file injection via unsanitized persistent option values

02

newline/carriage-return input validation added

03

RPC parameter rejection with JSONRPC2_INVALID_PARAMS

04

transient values excluded from restriction, indicating persistent storage is the attack surface

05

commit message explicitly calls the issue 'config-line injection'

Risk score

Why this scored 62/100

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