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

cli: add command to export preimage

Public commit record

What the developer wrote

Authored by f321x

76/100 · Adequate
cli: add command to export preimage

..also export preimage in check_hold_invoice return value if available.

I intentionally did not return the preimage in the returned dict of
wallet.export_requests as this seems risky to do considering some users
of the cli might forward the response to a payer and the payserver
exposes it too.

Closes https://github.com/spesmilo/electrum/issues/10176
✓ 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 adds a new command-line feature to export the secret 'preimage' for a settled Lightning invoice, and also includes the preimage in the result of checking a held invoice. The preimage is the cryptographic proof that a Lightning payment was received; anyone who knows it can claim the payment. The developers deliberately avoided exposing the preimage in some other command outputs because it could be accidentally shared with a payer or exposed via the payment server. The change itself is a feature addition, not a fix for an active vulnerability, but it touches sensitive secret material.

Recommended action

Treat this as a security-sensitive feature addition rather than an emergency vulnerability. Review access controls around the new CLI command and ensure the preimage is not logged, cached, or returned in contexts where it could be forwarded to untrusted parties. Verify that the payserver and any RPC consumers do not inadvertently expose `export_requests` preimage data. Consider documenting the command's sensitivity for users.

Security signals we found

01

New CLI command exports Lightning payment preimage, a secret that authorizes payment settlement

02

Commit message explicitly discusses risk of preimage exposure via CLI responses and payserver

03

Assertion added to verify preimage correctness before returning it

04

Preimage added to `check_hold_invoice` return value and to paid Lightning request exports

05

No CVE, advisory, or vendor security disclosure present in supplied materials

Risk score

Why this scored 21/100

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