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

swaps: handle negative PoW nonce gracefully

Public commit record

What the developer wrote

Authored by f321x

60/100 · Adequate
swaps: handle negative PoW nonce gracefully

Handle negative nonces in swap announcement events gracefully.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit fixes a small bug in Electrum's submarine swap feature. When a swap server advertises itself using a Nostr event, the client checks a 'proof-of-work nonce' to verify the server did enough computational work. Before the patch, a negative nonce could slip through and be treated as valid, potentially letting a low-effort or malicious swap server bypass the anti-spam check. The fix treats negative nonces the same as a missing nonce (zero proof-of-work bits).

Recommended action

Treat as a low-severity hardening patch. Users running submarine swaps should update to a version containing this commit. No immediate emergency response is warranted, but the fix should be included in the next release.

Security signals we found

01

Input validation hardening for externally supplied PoW nonce

02

Negative integer nonce could bypass or distort proof-of-work scoring

03

Nostr swap announcement parsing is an untrusted input surface

04

Fix is minimal and defensive, suggesting a recognized edge case

Risk score

Why this scored 37/100

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