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

lnonion: check onion version in process_onion_packet

Public commit record

What the developer wrote

Authored by f321x

73/100 · Adequate
lnonion: check onion version in process_onion_packet

Adds checks for the onion version in process_onion_packet and fails it
back with the correct error instead of raising in the OnionPacket
constructor.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change tightens how Electrum's Lightning code handles onion-routed payment packets. Previously, an unsupported onion packet version would trigger a broad exception while the packet was being decoded. Now the version is stored and checked later in processing, allowing the code to send a proper Lightning protocol failure message back instead of crashing or misbehaving. It is a defensive correctness fix rather than a clear-cut vulnerability patch.

Recommended action

Review callers of process_onion_packet to ensure UnsupportedOnionPacketVersion is converted into the correct BOLT-4 failure packet (bad_onion|invalid_onion_version). Complete the TODO regarding required_node_feature_missing checks.

Security signals we found

01

Moved version validation from deserialization into processing path

02

Unsupported onion version now raises a specific exception usable for protocol-level failure

03

Added TODO for missing feature-flag compliance checks

Risk score

Why this scored 42/100

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