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

askrene: safer iterating over changing htable

Public commit record

What the developer wrote

Authored by Lagrang3

68/100 · Adequate
askrene: safer iterating over changing htable

on trim_constraints:
to be sure we don't miss elements we add to the hash table after the
loop and not during iteration.

Changelog-None

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 change fixes a subtle bug in Core Lightning's askrene plugin where adding items back into a hash table while looping through it could cause some items to be skipped. The fix collects items that need to be re-added and inserts them only after the loop finishes. The main risk is that the old code could leave stale routing constraints in place, potentially affecting payment routing decisions rather than directly stealing funds.

Recommended action

Review whether the same insert-during-iteration risk exists in the bias_hash and node_bias_hash loops in the same function and apply a consistent deferred-insertion pattern if needed. Otherwise, this patch should be included in routine maintenance.

Security signals we found

01

Hash table mutation during iteration

02

Potential skipped entries leading to stale routing constraints

03

Routing-layer correctness issue

04

No direct memory corruption or cryptographic weakness

Risk score

Why this scored 32/100

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