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

askrene: fix use-after-free if remove_htlc_min_violations fails.

Public commit record

What the developer wrote

Authored by Rusty Russell

78/100 · Adequate
askrene: fix use-after-free if remove_htlc_min_violations fails.

It can only fail on overflow, but if it did, the fail path frees working_ctx
and returns "error_message".

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

What changed, and why it matters

This commit fixes a rare programming bug in Core Lightning's 'askrene' routing plugin. If a specific internal function failed due to an overflow, the code would free a memory context and then try to use it again on the error-handling path, which is a use-after-free. The patch changes the function to use a longer-lived memory context so the error path is safe. The failure condition is described as only possible on overflow, making real-world exploitation unlikely.

Recommended action

Apply the patch. Review other error paths in askrene to ensure allocations intended to outlive working_ctx use the correct parent context. Consider adding static analysis or fuzzing for overflow-triggered failure paths in the routing plugin.

Security signals we found

01

use-after-free bug on error path

02

memory context mismatch between allocation and cleanup

03

potential dangling pointer returned to caller

04

overflow-triggered failure path

Risk score

Why this scored 41/100

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