NWC: a relay can forge a wallet's response
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- authentication, security
Direzione di ricerca
Start with send_request in rust/src/nwc/client.rs and trace how it filters, decrypts, and matches response events to requests. Check the NWC URI fields and existing tests or callers before changing behavior. Done means responses are accepted only when signed by the wallet and referencing the request, so forged and unrelated responses are rejected.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The NWC client takes the first kind 23195 event it can decrypt as the wallet's answer (send_request in rust/src/nwc/client.rs). It decrypts with the event's own author (event.pubkey), not with the wallet's key, and checks neither the author nor the request id. The relay's .author() filter is the only guard, and a relay can ignore it.
So a relay can sign a response with its own key and encrypt it to the client's public key, which is visible as the author of every request. The client accepts it: for example a make_invoice result carrying the attacker's invoice, which the buyer's screen then submits to Mostro. An answer meant for another request on the same connection is accepted the same way.
Proposal: decrypt with the wallet's key from the URI, and accept only responses signed by the wallet that reference the request. @grunch found this while reviewing #650; this issue splits it out as its own fix.
- Lingua principale
- Dart
- Stelle
- 11
- Fork
- 9
- Merge medio
- 14h 3m
- PR unite (30g)
- 135
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MostroP2P/app
-
area: rust-core bug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
area: ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
area: ui feature priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
MostroP2P/app#124 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di MostroP2P/app
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
madeofpendletonwool/PinePods#1078 ·
I maintainer di solito rispondono entro 1 giorno
-
Remove cachet from all linksAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
carp-dk/cognition_package#40 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
daniel-pimenta-cc/ledor#58 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
hiddify/hiddify-app#2453 ·
I maintainer di solito rispondono entro 1 giorno