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

Refuse to sign messages that alias channel_announcement serializations

Public commit record

What the developer wrote

Authored by auto-pr-bot

100/100 · Strong
Refuse to sign messages that alias channel_announcement serializations

@matt asked:

> @auto-pr-bot it looks like lightning signed messages can alias more
> gossip types than the one we currently check, please go ahead and
> make sure our code prevents such aliasing.

Only `node_announcement` was previously checked, on the reasoning that
the other signed gossip types carry a `chain_hash` which gossip
processing validates against the genesis hash before their signature is
processed. That reasoning only holds for `channel_update`, whose
serialization begins with its `chain_hash`: a `channel_announcement`,
like a `node_announcement`, begins with a two-byte feature vector length
that the "Lightning Signed Message:" prefix parses as 0x4c69 bytes,
leaving its `chain_hash` entirely caller-controlled and free to hold a
real genesis hash. A `signmessage` signature over such a serialization
would verify as a (forged) `channel_announcement` signature.

Extend the round-trip check to `channel_announcement` serializations,
and to `channel_update` as well so that the refusal is structural rather
than relying on no real chain's genesis hash starting with
"Lightning Signed Message:".

Fixes #5725

Requested-by: @matt
Link: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/issues/5725
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a security gap in how the Lightning Dev Kit signs arbitrary messages. Previously, the code refused to sign messages that could be mistaken for a 'node_announcement' gossip message, because such a signature could be replayed as a forged gossip signature. However, it did not check for 'channel_announcement' or 'channel_update' messages. An attacker could craft a message that, after adding the standard 'Lightning Signed Message:' prefix, looks like a valid channel announcement or update. The victim's signature on that harmless-looking message could then be used as a fake signature on a real gossip message. The patch now refuses to sign any message that serializes as one of these three gossip types, closing the forgery path.

Recommended action

Treat this as a security fix. Review any downstream code that calls `sign_message` or `message_signing::sign` and ensure it handles the new `Result` return and the expanded refusal cases. Backport to maintained release branches. No immediate runtime mitigation is needed beyond applying the patch.

Security signals we found

01

Signature replay / cross-protocol forgery prevention

02

Expansion of existing anti-aliasing guard to additional gossip message types

03

Commit message explicitly describes forged gossip signature risk

04

New unit tests demonstrate concrete channel_announcement and channel_update aliasing

05

Changelog frames change as security-relevant API update

Risk score

Why this scored 76/100

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