diff --git a/.agents/skills/nostr-security/SKILL.md b/.agents/skills/nostr-security/SKILL.md new file mode 100644 index 0000000..9b65185 --- /dev/null +++ b/.agents/skills/nostr-security/SKILL.md @@ -0,0 +1,259 @@ +--- +name: nostr-security +description: Secure handling of untrusted Nostr event data — author filtering for trust-sensitive queries (admin actions, moderators, addressable events, NIP-72 communities), URL sanitization before rendering event-sourced links/images, and CSS injection prevention when interpolating event data into styles. Load when building trust-boundary features, rendering user-controlled URLs, or interpolating event data into CSS. +--- + +# Nostr Security + +Nostr is permissionless: **anyone can publish any event claiming to be anything**. Events carry a cryptographic signature, but the signature only proves *the signer produced this content* — it says nothing about *whether you should trust that signer*. Every security decision in a Nostr client reduces to: **which pubkeys do we trust, and have we filtered our queries accordingly?** + +This skill covers three attack surfaces: + +1. **Trust-boundary queries** — how to use the `authors` filter so attackers can't forge admin/moderator/owner events. +2. **URL sanitization** — how to handle URLs extracted from event tags, content, or metadata. +3. **CSS injection** — how to safely interpolate event data into `