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

Refuse to pay BOLT 12 invoices with records above experimental range

Public commit record

What the developer wrote

Authored by auto-pr-bot

81/100 · Strong
Refuse to pay BOLT 12 invoices with records above experimental range

@matt asked in #5668:

It seems we shouldn't be rejecting TLVs over 4 billion at all, on the
reading side, per the spec. This might require a minor spec change to the
payer-proof spec, but that's okay. Still, just to be safe, let's refuse to
pay (in the bolt12 flow) any invoices with TLVs above 4 billion, even if
we happily deserialize them.

The previous commit made such invoices deserializable again, so a payee can
once again send us an invoice containing records we don't understand. An odd
record type requires comprehension to be honored, so refuse to initiate a BOLT
12 payment for an invoice containing a record at or above
EXPERIMENTAL_INVOICE_TYPES_END, in every path that pays one: invoices received
in reply to an invoice request or a refund (whether handled automatically or
via send_payment_for_bolt12_invoice), pay_for_bolt12_invoice, and static
invoices in the async payments flow.

The payment is failed with PaymentFailureReason::UnknownRequiredFeatures, like
other invoices carrying records we don't understand, rather than introducing a
new failure reason.

Fixes #5668

Requested-by: @matt
Link: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/issues/5668
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit hardens LDK's BOLT 12 payment logic so it refuses to pay invoices containing very large unknown record types (4 billion and up). These records are legal under the Lightning spec, but LDK doesn't understand them, so the change treats them like unknown required features and aborts payment before funds move. It is a defensive safety fix, not a response to an active exploit.

Recommended action

No immediate action beyond normal review and merge. Users should upgrade to a release containing this commit if they process BOLT 12 invoices from untrusted payees. Monitor the linked issue #5668 for any related spec clarification.

Security signals we found

01

Defensive refusal to pay invoices with unknown high-numbered TLV records

02

Reuses existing UnknownRequiredFeatures failure path instead of adding a new one

03

Adds explicit checks before payment state insertion and route construction

04

Includes unit tests for detection and payment rejection

05

References a spec discussion (#5668) about payer-proof safety

Risk score

Why this scored 48/100

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