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

bolt12: add ErrNilPublicKey and type the offer_issuer_id guard

Public commit record

What the developer wrote

Authored by bitromortac

73/100 · Adequate
bolt12: add ErrNilPublicKey and type the offer_issuer_id guard

The offer writer rejected a present-but-nil offer_issuer_id with an
ad-hoc error. Introduce a typed ErrNilPublicKey sentinel and use it here
so the rejection is recoverable by callers and reusable by the
invoice_request writer, which guards the same hazard for its own pubkey
fields.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit hardens LND's BOLT 12 offer handling by replacing a one-off panic-prevention check with a reusable, typed error. A malformed offer where a public-key field is technically 'present' but actually contains a nil pointer would previously crash during encoding; now it is cleanly rejected with a detectable error. The change is defensive and improves code quality, but it does not appear to fix an actively exploitable remote crash on its own because the nil path was already guarded on the write path and is now also guarded on the read path.

Recommended action

Treat as a low-risk hardening commit. Review whether other public-key TLV fields (e.g., in invoice_request) are also guarded by checkPubKeyNotNil, as the commit message suggests that is the intended follow-up. No urgent security response appears required.

Security signals we found

01

panic-prevention for nil public-key TLV encoding

02

typed sentinel error improves caller recoverability

03

reader-side guard added where only writer-side guard existed before

04

BOLT 12 offer validation hardening

Risk score

Why this scored 37/100

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