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

lnwire: cap decoded short channel IDs

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

78/100 · Adequate
lnwire: cap decoded short channel IDs

In this commit, we cap each decompressed short channel ID set at 100,000
entries, matching the aggregate range reply budget. The old zlib reader
bounded compressed input rather than decoded output, so the two working-set
limits could drift apart.

We retain compatibility with protocol-valid compressed replies, reject
truncated or corrupt zlib streams, and close the reader on every exit.
Boundary, compatibility, corruption, and property tests cover the
decoder.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit tightens a safety limit in LND's Lightning wire protocol parser. Previously, a compressed network message could decompress into an unbounded number of short channel IDs, potentially consuming far more memory than the wire message size suggested. The patch caps decoded short channel IDs at 100,000, closes the decompressor on every exit, and now treats truncated or corrupt zlib streams as errors rather than accepting partial results. It is a hardening fix against memory-exhaustion and parsing-ambiguity attacks during channel-graph synchronization.

Recommended action

Treat as a security hardening patch and include in the next maintenance release. Review whether 100,000 is consistent with other LND resource budgets and ensure downstream callers handle the new error without crashing. No immediate incident response is indicated absent a disclosed exploit.

Security signals we found

01

Resource-limit bypass: compressed-input bound did not bound decoded output

02

Memory-exhaustion risk from zlib decompression of peer-supplied data

03

Truncated/corrupt zlib streams previously accepted as valid partial results

04

Missing cleanup: zlib reader not closed on all exit paths

05

New explicit cap on decoded short channel IDs (100,000)

06

New boundary, compatibility, corruption, and property tests

Risk score

Why this scored 60/100

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