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

lightningd: don't allow invoices with 640 byte descriptions.

Public commit record

What the developer wrote

Authored by Rusty Russell

93/100 · Strong
lightningd: don't allow invoices with 640 byte descriptions.

They are invalid! This is because our BOLT11_FIELD_BYTE_LIMIT is not the limit,
it's one greater than the limit.

Reported-by: https://github.com/noblepayne
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: JSON-RPC: `invoice` no longer accepts 640-byte descriptions (it would produce malformed invoices).
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This fix stops Core Lightning from creating invalid BOLT11 invoices when a user supplies a 640-byte payment description. Previously the software treated 640 bytes as acceptable, but the Lightning protocol only allows 639 bytes, so a 640-byte description produced a malformed invoice that other wallets might reject or fail to parse correctly. The change tightens the length check and updates an internal constant so the limit is now correctly 639 bytes.

Recommended action

Upgrade nodes to a release containing this commit. If running an older version, avoid creating invoices with 640-byte descriptions and consider rejecting or re-issuing any such invoices already generated.

Security signals we found

01

Protocol compliance bug producing malformed invoices

02

Off-by-one length limit in BOLT11 field encoding

03

Input validation gap in JSON-RPC invoice endpoint

04

Potential interoperability/parsing failure for recipients

Risk score

Why this scored 37/100

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