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

xpay: ensure unique_id is always valid.

Public commit record

What the developer wrote

Authored by Rusty Russell

80/100 · Strong
xpay: ensure unique_id is always valid.

In implementing shadow, I added a call to payment_log in xpay_core,
which caused a valgrind error because we set unique_id later. This
was a premature optimization, so we didn't assign unique_id for
payments which didn't even start, but it's a footgun, and there are
other (less common) calls to payment_log too early which make the same
mistake.

Simplify: unique_id is assigned at creation.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This is a code-quality fix inside Core Lightning's xpay plugin. It moves the assignment of a payment's unique ID earlier in the payment's lifetime so that logging functions can safely use it. The bug caused valgrind warnings (use of uninitialized data) and could have led to confusing log output, but it is not an exploitable security vulnerability.

Recommended action

No urgent action required. Treat as routine hardening. If running a build with xpay, include this commit to avoid uninitialized-memory reads and inconsistent log layer names.

Security signals we found

01

Use of uninitialized struct fields (unique_id, private_layer) before this patch

02

Valgrind error triggered by payment_log reading uninitialized unique_id

03

Fix is defensive hardening rather than a patch for an exploitable bug

Risk score

Why this scored 22/100

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