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

Read invoice TLV records above the experimental range

Public commit record

What the developer wrote

Authored by auto-pr-bot

81/100 · Strong
Read invoice TLV records above the 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.

Commit 5747866a6 ("offers: add BOLT 12 payer proof primitives") narrowed
EXPERIMENTAL_INVOICE_TYPES from 3_000_000_000.. to 3_000_000_000..4_000_000_000.
The same parser also deserializes invoices LDK persisted itself, via
HTLCSource::OutboundRoute's bolt12_invoice field, which ChannelMonitor::read
reads for the HTLCs of holder commitments, so a monitor written by LDK 0.2 for
a channel that paid an invoice whose payee appended an odd TLV record with a
type above 4,000,000,000 fails to load with InvalidValue after upgrading. Since
read_channel_monitors fails on the first unreadable monitor, none of the node's
channels are watched until the operator intervenes.

The spec places no upper bound on TLV record types, so parse the experimental
range as open-ended again, as LDK 0.2 and earlier did. EXPERIMENTAL_INVOICE_TYPES_END
keeps the 4,000,000,000 bound where it is still enforced: the payer-proof
omitted-marker validation, which takes the bound from the payer-proof spec, and
refusing to pay such invoices, added in the following commit.

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 fixes a backward-compatibility bug in LDK's BOLT 12 invoice parser. A previous change had capped the range of 'experimental' TLV record types at 4 billion, but the Lightning spec imposes no upper bound. As a result, invoices created or stored by LDK 0.2 that contained odd experimental TLVs above 4 billion became unreadable after upgrading. Because these invoices are embedded in channel monitors, a single unreadable monitor could block all of a node's channels from being watched until the operator manually intervened. The patch reopens the parsing range while keeping the 4 billion limit only where it is still meaningful: payer-proof validation and refusing to pay such invoices.

Recommended action

Apply the patch to restore backward-compatible invoice parsing. Operators already affected by unreadable monitors should upgrade and restart; the fix allows monitors with such invoices to load. Review any custom tooling that may have relied on the 4 billion upper bound for parsing experimental TLVs.

Security signals we found

01

Backward-compatibility regression in deserialization of persisted channel monitors

02

Denial-of-service via unreadable monitor blocking all channel monitoring

03

Spec compliance fix: TLV record types have no upper bound

04

Payer-proof validation still enforces the 4 billion bound for omitted markers

05

Payment refusal for invoices with records above 4 billion retained in following commit

Risk score

Why this scored 64/100

Our methodology →
Potential impact 22/30
Exploitability 12/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.