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

lighting-cli: fix invalid json

Public commit record

What the developer wrote

Authored by Lagrang3

68/100 · Adequate
lighting-cli: fix invalid json

Changelog-Fixed: lightning-cli: fix invalid json requests when input includes a numeric string with leading zeroes

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 fixes a bug in the lightning-cli command-line tool. Previously, if a user typed a numeric string starting with zero (like '0123'), the tool would send it to the lightningd server as a bare number. In JSON, numbers with leading zeros are invalid, so plugins written in Rust or Python could crash when parsing the request. The fix forces such strings to be quoted, making them valid JSON strings instead of invalid numbers. A previously-skipped test that checks for valid JSON from the CLI is re-enabled.

Recommended action

Treat this as a low-severity reliability/robustness fix. No immediate security response is required, but users and integrators should update to avoid RPC failures or plugin crashes when passing zero-padded numeric strings via lightning-cli. Review other CLI argument literalization rules for similar JSON validity edge cases.

Security signals we found

01

Input validation bug in CLI argument parsing

02

Generated invalid JSON for numeric strings with leading zeros

03

Could cause downstream RPC consumers/plugins to crash on malformed input

04

Regression test re-enabled after fix

Risk score

Why this scored 37/100

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