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

Merge PR 'Refuse to sign messages that collide with gossip serializations' (#5677)

Public commit record

What the developer wrote

Authored by Matt Corallo

81/100 · Strong
Merge PR 'Refuse to sign messages that collide with gossip serializations' (#5677)

from auto-pr-bot/bot/386-lightning-signed-mesages-can-be-43bc68 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5677
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This change fixes a security issue where a signed text message could be crafted so that its prefixed form looks exactly like a Lightning 'node_announcement' gossip message. Because both use the same double-SHA256 hash and the same signing key, an attacker could take a legitimate node's signed message and replay it as a forged gossip announcement, potentially impersonating or misrepresenting that node on the network. The patch makes the signing function refuse to sign any message whose prefixed bytes form a valid node_announcement serialization, and updates the API to return a Result so callers can handle the refusal.

Recommended action

Upgrade to a release containing this commit. Review any custom `NodeSigner::sign_message` implementations to ensure they also refuse to sign prefixed messages that serialize as `node_announcement` (or delegate to the updated `message_signing::sign`). Audit existing signed-message APIs and logs for any reliance on the previous infallible `String` return type.

Security signals we found

01

Signature replay / message confusion between signed messages and gossip announcements

02

Forged `node_announcement` signatures via chosen-prefix message construction

03

New validation rejects prefixed messages that deserialize as `UnsignedNodeAnnouncement`

04

API breaking change: `sign` now returns `Result<String, ()>` instead of `String`

05

Changelog explicitly describes the security-relevant behavior change

Risk score

Why this scored 74/100

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