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

Check metadata length for bolt11 invoices

Public commit record

What the developer wrote

Authored by elnosh

60/100 · Adequate
Check metadata length for bolt11 invoices

Check that the metadata when creating a bolt11 invoice is below
the bolt11 limit of 639 bytes for tagged fields.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit fixes a missing length check when creating BOLT11 Lightning invoices. Before the fix, a user or attacker could supply payment metadata longer than the 639-byte BOLT11 limit, producing an invoice that violates the protocol and may fail to be parsed or routed correctly. The patch now rejects oversized metadata during invoice creation, similar to the existing check for descriptions.

Recommended action

Review whether any other optional tagged fields (route hints, fallback addresses, expiry, etc.) have similar missing length checks, and ensure all BOLT11 length limits are enforced consistently during invoice creation. Consider adding fuzz or property tests for invoice builder inputs.

Security signals we found

01

Missing input validation on BOLT11 invoice metadata length

02

Protocol compliance violation: tagged field exceeds 639-byte BOLT11 limit

03

New error variant CreationError::PaymentMetadataTooLong introduced

04

Unit test added for oversized metadata rejection

Risk score

Why this scored 60/100

Our methodology →
Potential impact 18/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.