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

Reject pre-epoch `LSPSDateTime` at parse time

Public commit record

What the developer wrote

Authored by Elias Rohrer

80/100 · Strong
Reject pre-epoch `LSPSDateTime` at parse time

`LSPSDateTime::is_past` coerced `chrono`'s `i64` timestamp into a
`u64` via `try_into().expect(...)`. Because `LSPSDateTime` is parsed
from peer-controlled RFC 3339 strings (which can be pre-1970 and so
yield negative timestamps), this could be triggered remotely: an
attacker-supplied `valid_until` / `expires_at` field of e.g.
`"1900-01-01T00:00:00Z"` would parse successfully, land in LSPS state
before any HMAC / promise check, and panic the LSP thread on the next
`prune_pending_requests` sweep. Concretely reachable today via LSPS2
`opening_fee_params.valid_until` (in the buy request) and the LSPS1
expiry fields.

Make `LSPSDateTime::from_str` reject pre-epoch datetimes, and route
serde deserialization through it: `#[serde(transparent)]` was
delegating Deserialize directly to `chrono`'s impl and bypassing our
parser, so peer JSON had to be guarded separately. With both paths
funnelled through one parser, no `LSPSDateTime` value with a negative
inner timestamp can be constructed and `is_past` is safe by
construction.

Co-Authored-By: HAL 9000
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a remote denial-of-service bug in rust-lightning's LSPS (Lightning Service Provider Specification) code. An attacker could send a specially crafted date string from before 1970 (like "1900-01-01T00:00:00Z") in certain peer messages. The date would be accepted, and later when the software checked whether it had expired, it would panic and crash the LSP thread. The fix rejects any pre-1970 date during parsing, including when reading JSON from peers, so the dangerous value can never be created.

Recommended action

Treat this as a security fix and include it in the next maintenance release. Users running LSP nodes with LSPS1/LSPS2 services should upgrade promptly because the panic is remotely triggerable without authentication. No immediate downstream mitigation is available other than patching or disabling LSPS services.

Security signals we found

01

Remote-triggerable panic (DoS) via peer-controlled input

02

Integer conversion panic: i64 negative timestamp coerced to u64 with .expect()

03

Input validation bypass: serde transparent deserialization skipped custom parser

04

Fix funnels both FromStr and serde deserialization through a single parser

05

Regression test added for both parse paths

Risk score

Why this scored 76/100

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