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

keysend: enforce BOLT11 description length limit

Public commit record

What the developer wrote

Authored by Wes Payne

78/100 · Adequate
keysend: enforce BOLT11 description length limit

The keysend plugin previously used `> 1023` as the cutoff for
description length when inserting an invoice. This was
inconsistent with invoice.c, which enforces the BOLT11 description
field limit defined in `common/bolt11.h`.

This patch switches to using `BOLT11_FIELD_BYTE_LIMIT` directly.
As a result, keysend no longer fails on descriptions between
641–1023 bytes, which previously caused unexpected failures.

A new regression test (`test_keysend_description_size_limit`)
exercises boundary cases just below, at, and above the limit.

Changelog-Fixed: Protocol: `keysend` with descriptions of length 640-1023 bytes fixed.
Signed-off-by: Wes Payne <noblepayne@noblepayne.com>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug in Core Lightning's 'keysend' payment feature where invoice descriptions between 641 and 1023 bytes long were incorrectly rejected. The keysend plugin used a hard-coded 1023-byte cutoff, while the rest of the software enforced a stricter 640-byte BOLT11 protocol limit. The patch makes keysend use the same shared limit, so medium-length descriptions now work correctly. This is a reliability/standards-compliance fix rather than a critical security vulnerability.

Recommended action

No urgent action required. Users and operators running keysend payments with descriptions between 641 and 1023 bytes should upgrade to benefit from the fix. Reviewers may want to audit other plugins for similar hard-coded BOLT11 limit mismatches.

Security signals we found

01

Inconsistent validation between plugin and core protocol limit

02

Boundary condition fix with regression tests for lengths near the limit

03

Use of shared protocol constant instead of magic number

Risk score

Why this scored 35/100

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