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

swaps: more robust parsing

Public commit record

What the developer wrote

Authored by SomberNight

35/100 · Opaque
swaps: more robust parsing
✓ Descriptive subject! No meaningful explanatory body
The short version

What changed, and why it matters

This commit hardens how Electrum parses data received from external swap servers and Nostr direct messages. It adds type checks so that fields that should be dictionaries, integers, or valid Bitcoin addresses are rejected if malformed. Without these checks, a malicious or compromised swap server could send unexpected data types (for example, a string where a number is expected, or a non-address string as a lockup address) that might cause crashes, incorrect transaction construction, or potentially trick the wallet into sending funds to the wrong place. The commit does not fix a single known exploit; it is a broad defensive-hardening patch.

Recommended action

Treat as a security-hardening fix and include in the next release. Users who run submarine swaps or Nostr-based plugins should update. Review whether additional fields (e.g., invoice, fee_invoice, response_id, pairs fields) need similar validation, and consider adding tests with malicious swap-server responses.

Security signals we found

01

Input validation added for server-provided swap fields (amounts, locktime, address, redeem script)

02

Bitcoin address validity check added for lockup addresses from swap server

03

JSON response type enforcement (must be dict) in HTTP and Nostr transports

04

Malformed Nostr event content now rejected before processing in NWC, PSBT cosigner, and swap plugins

05

Swap server network errors converted to SwapServerError instead of propagating raw aiohttp exceptions

06

No explicit CVE, advisory, or security disclosure referenced in commit or supplied materials

Risk score

Why this scored 58/100

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