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

getroutes: don't crash on source==destination

Public commit record

What the developer wrote

Authored by Lagrang3

68/100 · Adequate
getroutes: don't crash on source==destination

```
cln-askrene: plugins/askrene/child/child.c:40: final_hop: Assertion `tal_count(hops) > 0' failed.
cln-askrene: FATAL SIGNAL 6 (version v26.06-19-g46b039d)
lightningd-1 2026-06-15T12:34:26.296Z DEBUG plugin-cln-askrene: notify msg debug: Final answer has 1 flows
0x55ab65429902 send_backtrace
common/daemon.c:38
0x55ab6542998c crashdump
common/daemon.c:83
0x7fbc84a8bdef ???
./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x7fbc84ae095c __pthread_kill_implementation
./nptl/pthread_kill.c:44
0x7fbc84a8bcc1 __GI_raise
../sysdeps/posix/raise.c:26
0x7fbc84a744ab __GI_abort
./stdlib/abort.c:77
0x7fbc84a7441f __assert_fail_base
./assert/assert.c:118
0x55ab6541b60c final_hop
plugins/askrene/child/child.c:40
0x55ab6541b70d fmt_route
plugins/askrene/child/child.c:48
0x55ab6541ba5b convert_flows_to_routes
plugins/askrene/child/child.c:135
0x55ab6541c037 run_child
plugins/askrene/child/child.c:265
0x55ab65416caa do_getroutes
plugins/askrene/askrene.c:711
0x55ab65416d28 begin_request
plugins/askrene/askrene.c:887
0x55ab654170a2 json_getroutes
plugins/askrene/askrene.c:968
0x55ab654285ec ld_command_handle
plugins/libplugin.c:2206
0x55ab654287f6 ld_read_json
plugins/libplugin.c:2282
0x55ab65439261 next_plan
ccan/ccan/io/io.c:60
0x55ab65439580 do_plan
ccan/ccan/io/io.c:422
0x55ab65439639 io_ready
ccan/ccan/io/io.c:439
0x55ab6543a5fc io_loop
ccan/ccan/io/poll.c:470
0x55ab65428bc4 plugin_main
plugins/libplugin.c:2481
0x55ab65417491 main
plugins/askrene/askrene.c:1551
0x7fbc84a75ca7 __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
0x7fbc84a75d64 __libc_start_main_impl
../csu/libc-start.c:360
0x55ab65413920 ???
_start+0x20:0
0xffffffffffffffff ???
???:0
```

Changelog-Fixed: askrene-getroutes: don't crash on invalid user input, source==destination

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
✓ 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 routing plugin (cln-askrene). When a user called the getroutes command with the same node as both source and destination, the plugin hit an internal assertion and aborted. The fix adds a simple input check that rejects source==destination with a normal RPC error instead of crashing the plugin.

Recommended action

Apply the patch to add the source/destination equality check and enable the regression test. No further immediate action is required; this is a straightforward input-validation hardening fix.

Security signals we found

01

Denial-of-service via malformed RPC input causing plugin abort

02

Assertion failure in routing plugin child process

03

Input validation gap in JSON-RPC command handler

Risk score

Why this scored 59/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 5/15
Affected reach 10/15
Confidence 9/10
Evidence quality 5/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.