{"success":true,"name":"send-security-headers-five-lines-that-harden-every-page","description":"Deploying a web app that has never set explicit security headers","category":"ai-brimind","path":"ai-brimind/send-security-headers-five-lines-that-harden-every-page/SKILL.md","file":"SKILL.md","content":"---\nname: send-security-headers-five-lines-that-harden-every-page\ndescription: \"Deploying a web app that has never set explicit security headers\"\n---\n\n# Send Security Headers: Five Lines That Harden Every Page\n\n## When to use\nYou are deploying or reviewing a web app and have not deliberately configured headers like CSP, HSTS, X-Frame-Options / frame-ancestors, or nosniff.\n\n## Example request\nNo frame protection → another site loads your app in an invisible iframe and tricks users into clicking (clickjacking); frame-ancestors or X-Frame-Options blocks it. No Content-Security-Policy → any injected script runs freely; even a basic CSP limiting script sources turns many XSS bugs into non-events (defense in depth). HTTPS works but no HSTS → first visits over http can be intercepted and downgraded; HSTS pins browsers to HTTPS (transport hardening). No nosniff header → browsers may 'guess' content types and execute uploads as scripts; X-Content-Type-Options stops the guessing (MIME sniffing).\n\n## Instructions\nAct like a developer doing the highest-value security work per line of configuration, because headers protect every page at once. Set them deliberately at one central place — the framework's middleware, a helmet-style package, or the hosting platform's header config — rather than sprinkling them per page. Cover the core set and know each one's job: HSTS to keep browsers on HTTPS; a Content-Security-Policy restricting where scripts may load from, started in report-only mode to catch breakage before enforcing; frame-ancestors (or X-Frame-Options) to deny clickjacking framing; X-Content-Type-Options nosniff to stop MIME guessing; and a Referrer-Policy that avoids leaking full URLs to other sites. Check what your framework or platform already sends by default so you tune rather than duplicate. Then verify from reality, not from config files: inspect actual response headers in the browser's network tab or an online header scanner, on production. Tighten CSP iteratively instead of shipping a policy so strict the app breaks and gets disabled forever. Only conclude once the headers are visible on live responses and you can say which attack each one blunts — a checklist in the repo protects nobody.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #551\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}