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

wallet: handle null currency fields, skip & warn on mismatch.

Public commit record

What the developer wrote

Authored by Rusty Russell

73/100 · Adequate
wallet: handle null currency fields, skip & warn on mismatch.

If they ran off master, currency can be null:

```
2025-08-21T10:03:04.566Z **BROKEN** lightningd: bookkeper migration: Accessing a null column e.currency/7 in query SELECT e.id, e.account_id, a.name, e.tag, e.credit, e.debit, e.fees, e.currency, e.payment_id, e.part_id, e.timestamp, e.ev_desc, e.rebalance_id FROM channel_events e LEFT OUTER JOIN accounts a ON a.id = e.account_id ORDER BY e.timestamp, e.id;
```

So allow this, but *also* check if it's a different currency and skip. This won't happen: you had to manually inject events in a different currency.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a database migration crash in Core Lightning. When upgrading, the migration code could hit a NULL currency field and abort with a 'BROKEN' error. The patch lets the migration tolerate NULL currencies and also skips any records that use an unexpected foreign currency, logging a warning instead of crashing. It is a robustness fix for an unusual upgrade path, not a typical remote attack vector.

Recommended action

Treat as a routine bug-fix patch. Users on affected master builds should upgrade before migrating. No urgent security response is indicated, but verify that migration logs do not show unexpected skipped foreign-currency events.

Security signals we found

01

NULL pointer / null-column access prevented

02

Migration robustness improvement

03

Foreign-currency event skipped rather than processed

04

No explicit security framing by vendor

Risk score

Why this scored 22/100

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