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

Fix panic when deserializing `Duration`

Public commit record

What the developer wrote

Authored by Matt Corallo

73/100 · Adequate
Fix panic when deserializing `Duration`

`Duration::new` adds any nanoseconds in excess of a second to the
second part. This can overflow, however, panicking. In 0.2 we
introduced a few further cases where we store `Duration`s,
specifically some when handling network messages.

Sadly, that introduced a remotely-triggerable crash where someone
can send us, for example, a malicious blinded path context which
can cause us to panic.

Found by the `onion_message` fuzzer
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a bug where a specially crafted network message could cause the Lightning Dev Kit software to crash. The crash happens while reading a time duration from the message. The fix rejects obviously invalid duration values before they can trigger the crash. The bug was discovered by an automated fuzz tester, not a reported real-world attack.

Recommended action

Apply the patch. Ensure all `Duration` deserialization paths use the validated `Readable` implementation. Consider adding regression tests or corpus entries from the `onion_message` fuzzer. No immediate incident-response action is indicated absent evidence of active exploitation.

Security signals we found

01

Remote denial-of-service (panic/crash) via deserialization of untrusted input

02

Integer overflow-like panic in standard-library wrapper (`Duration::new`)

03

Missing input validation before constructing `Duration`

04

Network-message parsing path affected (onion/blinded path context)

05

Fuzzer-discovered, not a reported in-the-wild exploit

Risk score

Why this scored 79/100

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