mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-03 08:07:21 +00:00
Drop 'Encourage NIP-07/NIP-46' framing from nostr-security skill
The previous subsection ranked login methods by safety, which misstates the threat: NIP-07 extensions have their own attack surface (malicious or compromised extensions can silently sign arbitrary events) and NIP-46 relies on a separate signer's security posture. Either way, an XSS on the app's origin can ask an active signer to sign anything, drain funds via zap requests, or scrape DMs as they're decrypted. Replace with a single sentence noting that remote-signer flows don't change the XSS mitigation story — same defenses apply regardless of login method.
This commit is contained in:
1 file changed
+1
-7
@@ -17,13 +17,7 @@ A successful XSS on any page of the app = instant, silent, irreversible key thef
|
||||
|
||||
**Every security practice in this skill exists to make XSS harder to achieve.** The stakes for a Nostr client are substantially higher than for a typical web app — treat every bit of untrusted data (event tags, `content`, metadata fields, URL parameters, relay responses) as a potential script injection vector.
|
||||
|
||||
### Why localStorage at all?
|
||||
|
||||
NIP-07 browser extensions and NIP-46 remote signers keep keys out of the web app's origin and are strongly preferred. But the app still has to support users who log in via `nsec` or who generate a new keypair in-browser, and those end up in `localStorage`. The mitigation story is therefore:
|
||||
|
||||
1. **Encourage NIP-07 / NIP-46** in the login UI (already done by `LoginArea`).
|
||||
2. **Make XSS as hard as possible** via CSP + sanitization + avoiding `dangerouslySetInnerHTML`.
|
||||
3. **Filter trust-sensitive queries by author** so an attacker can't trick the UI into acting on forged "admin" events (still a form of impersonation, even if no key is stolen).
|
||||
NIP-07 browser extensions and NIP-46 remote signers keep the key material outside the web app's origin, but they don't change this threat model: a successful XSS can still ask an active signer to sign arbitrary events, drain funds via zap requests, publish malicious content under the user's identity, or scrape plaintext DMs as they're decrypted. The mitigation story is the same regardless of login method — make XSS hard, and filter trust-sensitive queries by author.
|
||||
|
||||
## Defense-in-depth layers
|
||||
|
||||
|
||||
Reference in new issue
Block a user