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

askrene: fix infinite loop if refine_flows() cuts down our last flow with 1 remaining before maxparts.

Public commit record

What the developer wrote

Authored by Rusty Russell

73/100 · Adequate
askrene: fix infinite loop if refine_flows() cuts down our last flow with 1 remaining before maxparts.

1. We would find a flow.
2. refine_flow would reduce it so it doesn't deliver enough.
3. So we need to find another, but we are at the limit.
4. So we remove the flow we found.
5. Goto 1.

This can be fixed by disabling a channel which we caused us to reduce the flow,
so we should always make forward progress.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: Plugins: `askrene` could enter an infinite loop when maxparts is restricted.
✓ Specific, 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 bug in Core Lightning's `askrene` routing plugin where the program could get stuck in an infinite loop while trying to find payment routes. The loop happened when the route-finder kept finding a path, the path was then reduced because one channel couldn't handle the amount, and the reduced path was discarded because it was the only one found and the user had limited how many route pieces (maxparts) could be used. The fix marks the problematic channel as disabled so the algorithm makes forward progress instead of repeating the same dead-end path forever. It is a denial-of-service/availability issue rather than a loss-of-funds or code-execution vulnerability.

Recommended action

Upgrade to a Core Lightning release containing this commit. No immediate workaround is required; the issue is triggered by specific network/channel constraints combined with a restricted `maxparts` setting. Monitor `askrene` logs for hung payment attempts if running an older version.

Security signals we found

01

Infinite loop / non-termination in route-finding plugin

02

Denial-of-service against payment routing availability

03

Out-parameter added to propagate bottleneck channel index

04

Channel disabled to guarantee algorithm progress

05

Previously failing regression test re-enabled

Risk score

Why this scored 47/100

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