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

lnwire: preserve channel update extras

Public commit record

What the developer wrote

Authored by yyforyongyu

83/100 · Strong
lnwire: preserve channel update extras

Canonicalize channel update TLV data without mutating the message during
encoding. This keeps unknown records intact, reconciles legacy duplicate
inbound fee representations, and makes signing match the emitted bytes.

Cover receiver immutability, legacy encoding shapes, concurrent
encoding, and signature verification across a wire round trip.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This change fixes how Lightning channel-update messages handle optional extra data. Previously, encoding could silently rewrite the message's internal byte slice, which could cause signature mismatches, lost unknown fields, and race conditions when the same message was encoded from multiple threads. The patch now builds a fresh canonical copy of the extra data for each encoding/signing operation without changing the original message. The tests explicitly verify that signatures still verify after a full encode-decode round trip, that unknown fields survive, and that concurrent encoders no longer race.

Recommended action

Treat this as a hardening/reliability fix and include it in the next maintenance release. Review any persisted ChannelUpdate1 records that relied on the previous in-place mutation behavior, and run the new tests (especially the concurrent-encoding and signature round-trip tests) in CI. No immediate emergency response is indicated by the supplied materials, but the signature-consistency fix is security-relevant for Lightning protocol correctness.

Security signals we found

01

Signature malleability / mismatch risk: DataToSign and Encode now produce the same canonical bytes without mutating the message, preventing cases where signing and wire encoding could diverge.

02

Race condition: concurrent Encode calls no longer share and rewrite the receiver's ExtraOpaqueData slice.

03

Data loss / downgrade: unknown TLV records are preserved instead of being overwritten by the inbound-fee merge.

04

Legacy compatibility: persisted updates with inbound fee stored only in ExtraOpaqueData continue to round-trip correctly.

05

No explicit CVE, advisory, or vendor security disclosure is present in the supplied materials.

Risk score

Why this scored 59/100

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