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

Merge pull request #11001 from spesmilo/jit_forward_checks

Public commit record

What the developer wrote

Authored by Felix

58/100 · Thin
Merge pull request #11001 from spesmilo/jit_forward_checks

Jit forward checks
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
The short version

What changed, and why it matters

This commit hardens Electrum's Lightning 'just-in-time' (JIT) channel feature by adding safety checks before opening a new channel on the fly. Previously, some incoming payment checks were skipped when a JIT channel was opened, which could let a malicious or buggy payment push the node into opening a channel under bad terms (for example, with insufficient fees, an unrealistic expiry, or an invalid onion payload). The patch moves those checks to happen before the channel is created and makes sure failures are reported back as standard Lightning errors rather than internal exceptions. It also adds tests demonstrating the new protections.

Recommended action

Treat this as a security-hardening fix and include it in the next release. Users running Lightning routing/forwarding nodes with JIT channels (zeroconf) should upgrade. Review whether the hardcoded forwarding_cltv_delta=144 and forwarding_fees=0 for plain JIT forwards are appropriate for all deployments.

Security signals we found

01

Adds input validation before state-changing JIT channel open

02

Converts unhandled exceptions into standard Lightning failure onion errors, preventing node-side crashes or unhandled exceptions from stalling HTLC resolution

03

Validates trampoline outgoing CLTV budget and incoming CLTV delta before onion creation

04

Adds unit tests explicitly asserting that malicious/bad HTLCs fail with specific OnionFailureCode values before a JIT channel is opened

Risk score

Why this scored 58/100

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