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

Fix: reject fake scids with invalid vout

Public commit record

What the developer wrote

Authored by Valentine Wallace

80/100 · Strong
Fix: reject fake scids with invalid vout

Previously, we would spuriously allow fake scids that had a vout with the high
byte set to pass our is_valid_{phantom,intercept,etc}_scid checks, even though
our fake vouts only ever set the lowest 3 bits of the 2-byte vout.

This can't really be exploited since HTLCs that pass this check would still
fail later on in the pipeline, and attackers that want to craft fake scids to
pass our checks can still do so after this fix, either via brute force or by
reusing a valid fake scid from a previously issued invoice. But at least this
makes it harder for them to do so, and makes the check more correct than it was
before. Plus invalid fake crafted scids like this could theoretically cause us
to generate a spurious HTLCIntercepted event, which wouldn't be ideal.

Reported by Project Loupe.
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a validation bug in how Lightning Dev Kit checks 'fake' short channel IDs (SCIDs) used for routing tricks like phantom and intercept payments. The old check compared only the lowest byte of the vout field, so an attacker could set the high byte of the vout and still pass validation. The fix now compares the full 16-bit vout value. The project says this is not directly exploitable for stealing funds, but it could cause a spurious internal event and makes the validation more correct.

Recommended action

Apply the patch. Review any other fake-SCID namespace validators for similar u16/u8 truncation issues. Consider whether downstream consumers that rely on HTLCIntercepted events need hardening against spurious events.

Security signals we found

01

Input validation bypass in fake SCID checks

02

Type-cast truncation bug (u16 to u8) leading to incorrect equality check

03

Potential for spurious HTLCIntercepted event generation

04

Reported by external security research group (Project Loupe)

Risk score

Why this scored 32/100

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