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

xpay: don't crash on circular routehints.

Public commit record

What the developer wrote

Authored by Rusty Russell

68/100 · Adequate
xpay: don't crash on circular routehints.

We earlier fixed the cases of gossipd inserting a same-node channel,
but didn't prevent it for local modifications:

```
cln-askrene: common/gossmap.c:52: nodeidx_htable_add: Assertion `!nodeidx_htable_getmatch_(ht, k, h, v, &i)' failed.
cln-askrene: FATAL SIGNAL 6 (version v26.06rc2-5-gd389c3f-modded)
0x5c50e80dd5cb send_backtrace
common/daemon.c:38
0x5c50e80dd685 crashdump
common/daemon.c:83
0x70a5b1e4532f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x70a5b1e9eb2c __pthread_kill_implementation
./nptl/pthread_kill.c:44
0x70a5b1e9eb2c __pthread_kill_internal
./nptl/pthread_kill.c:78
0x70a5b1e9eb2c __GI___pthread_kill
./nptl/pthread_kill.c:89
0x70a5b1e4527d __GI_raise
../sysdeps/posix/raise.c:26
0x70a5b1e288fe __GI_abort
./stdlib/abort.c:79
0x70a5b1e2881a __assert_fail_base
./assert/assert.c:96
0x70a5b1e3b516 __assert_fail
./assert/assert.c:105
0x5c50e80dfb44 nodeidx_htable_add
common/gossmap.c:52
0x5c50e80e1066 add_channel
common/gossmap.c:515
0x5c50e80e327c gossmap_apply_localmods
common/gossmap.c:1239
0x5c50e80bed55 do_getroutes
plugins/askrene/askrene.c:620
0x5c50e80bf919 listpeerchannels_done
```

Reported-by: Won Hoi Kim and Ahmad Elmoursi
Changelog-Fixed: Plugins: xpay no longer crashes on circular bolt11 routehints.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ 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 crash in Core Lightning's xpay plugin. When processing a BOLT11 invoice containing a circular route hint (where the start and end node are the same), the code would create an invalid self-loop channel and trigger a fatal assertion failure, killing the cln-askrene process. The patch rejects such self-loop channels at multiple layers so the payment plugin can skip them gracefully instead of crashing.

Recommended action

Apply the patch. The crash is remotely triggerable by presenting a crafted BOLT11 invoice with a circular routehint to xpay, so nodes running xpay should upgrade. No immediate workaround is documented; rejecting such invoices manually is impractical.

Security signals we found

01

Denial-of-service vector: malformed/circular BOLT11 routehint causes fatal assertion and process abort

02

Input validation gap: local channel creation allowed src == dst, breaking internal data structure invariant

03

Defense in depth: checks added at API boundary (askrene-create-channel), library layer (gossmap/layer), and plugin layer (xpay)

04

Crash-to-skip conversion: xpay now logs and ignores bad self-node route hints instead of propagating them

Risk score

Why this scored 45/100

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