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

Merge pull request #10833 from SomberNight/202608_swaps_dm_replies

Public commit record

What the developer wrote

Authored by ThomasV

73/100 · Adequate
Merge pull request #10833 from SomberNight/202608_swaps_dm_replies

swaps: nostr: check_dms: duplicate replies from server could crash transport
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This patch fixes a crash in Electrum's submarine swap feature when using Nostr direct messages. If a Nostr server sent the same reply twice, the code tried to complete an already-completed 'future' object, which raises an exception in Python's asyncio. The fix ignores duplicate or unknown replies instead of crashing. A malicious or misbehaving swap server could potentially trigger this to disrupt a user's swap transport/connection.

Recommended action

Apply the patch. Consider adding broader exception handling around future resolution in Nostr transport code, and monitor for other unguarded set_result/set_exception calls in async message handlers.

Security signals we found

01

asyncio.Future.set_result() called without done() check

02

unhandled InvalidStateError could crash async transport loop

03

duplicate Nostr DM reply from server treated as fatal instead of benign

04

denial-of-service vector against swap client transport

Risk score

Why this scored 46/100

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