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

pay: Enforce maxdelay for direct channel payments

Public commit record

What the developer wrote

Authored by wqxoxo

86/100 · Strong
pay: Enforce maxdelay for direct channel payments

When paying through a direct channel, direct_pay_override() creates a
route bypassing the normal routing path, which skips the CLTV budget
check in payment_getroute(). This allows payments to succeed even when
maxdelay is set below the required min_final_cltv_expiry.

Add a check in direct_pay_override() to verify the required CLTV
doesn't exceed cltv_budget before using the direct channel shortcut.
If it exceeds, skip the direct channel and let normal routing handle
the failure with a proper error message.

Fixes: #8609

Changelog-Fixed: pay: `maxdelay` parameter now enforced for direct channel payments
✓ 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 fix closes a loophole in Core Lightning's payment plugin. When a payer had a direct channel to the recipient, the plugin could bypass the normal route-finding step that checks whether the requested payment delay (CLTV) fits within the user's configured 'maxdelay' budget. As a result, a payment could go through even though the user explicitly asked not to accept such a long delay. The patch adds the missing budget check before taking the direct-channel shortcut and now rejects the payment with a clear error when the delay is too high.

Recommended action

Apply the patch. It is a targeted, low-risk fix that restores intended policy enforcement for direct-channel payments. No additional mitigation is required beyond normal update deployment.

Security signals we found

01

Bypassed security policy check (maxdelay/CLTV budget) in direct-channel payment path

02

Fixes reported issue #8609

03

Changelog entry explicitly labels the change as a fix for maxdelay enforcement

04

Regression test added to prevent reintroduction

Risk score

Why this scored 47/100

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