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

askrene: fix crash loading node bias with description

Public commit record

What the developer wrote

Authored by Vincenzo Palazzo

91/100 · Strong
askrene: fix crash loading node bias with description

load_node_bias() passed take(description) to two consecutive
set_node_bias() calls. The first call's tal_strdup() consumes the
take (tal_resize_ + tal_steal), so the second take() was on freed
memory and we aborted in to_tal_hdr() with "Not a valid header"
while loading the layer at startup. Since askrene is an important
plugin, lightningd shuts down and the node cannot restart at all.

The description is already a copy off tmpctx, so simply don't take()
it: set_node_bias() strdups it into the bias anyway.

With this, the test from the previous commit passes.

Fixes: #9433
Reported-by: endothermicdev
Changelog-Fixed: askrene: node failed to start (`exited before replying to init`) when a persistent layer contains a node bias with a description
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a bug in Core Lightning's askrene plugin that could prevent a node from restarting. When a saved routing layer contained a node bias with a description, the plugin accidentally freed the description's memory while using it a second time, causing an immediate crash during startup. The fix removes the incorrect 'take ownership' call so the description remains valid for both uses. There is no evidence this crash can be triggered remotely or used as an attack; it appears to be a reliability bug that only affects nodes that already have such saved data.

Recommended action

Apply the patch. It is a minimal, correct fix for a startup-crash bug. No additional hardening is suggested by the diff. Operators who cannot restart due to this bug can upgrade or temporarily remove the affected persistent askrene layer data after backing it up.

Security signals we found

01

Use-after-free / double-take of a tal-allocated string during plugin startup

02

Denial-of-service-like symptom: lightningd aborts before replying to init, node cannot restart

03

Fixes publicly reported issue #9433 by endothermicdev

04

Changelog explicitly frames it as a fixed startup failure

Risk score

Why this scored 59/100

Our methodology →
Potential impact 22/30
Exploitability 5/25
Stealth signal 8/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.