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

Merge PR 'Verify built invoice signatures and length' (#5306)

Public commit record

What the developer wrote

Authored by benthecarman

91/100 · Strong
Merge PR 'Verify built invoice signatures and length' (#5306)

from invoice-signing-hardening into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5306
Reviewed-by: joostjager <joostjager@noreply.git.rust-bitcoin.org>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit hardens how Lightning invoices are created and validated in rust-lightning. It now checks that the digital signature on a freshly built invoice actually matches the invoice contents, and it rejects invoices that would become too long once encoded. Previously, a buggy or malicious signer could produce an invoice with an invalid signature or one that exceeded protocol size limits, which could cause parsing failures or denial-of-service issues for other nodes.

Recommended action

Treat as a security hardening fix and include in the next release. Users building or parsing BOLT11 invoices with LDK should upgrade so that invalid-signature and over-long invoices are rejected at construction time rather than propagating to peers. No immediate emergency response is indicated because the issue is defensive and the commit does not describe an active exploit.

Security signals we found

01

New signature verification after invoice construction

02

New length enforcement at invoice construction and parsing boundaries

03

Refactoring of invoice signing path to share validation logic

04

Addition of regression tests for wrong signing key, max-length boundary, and too-long signed invoices

Risk score

Why this scored 62/100

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