Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Web Security Headers?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-web-security-headers)
---
description: Harden web apps with CSP, HSTS, secure cookies, CSRF protection and XSS-safe rendering
profile: standard
tags: security, web, xss, csrf
---
# Web security headers
Defense in depth for browsers.
## Headers
- `Content-Security-Policy` with nonces or hashes; no `unsafe-inline` scripts; start in report-only mode.
- `Strict-Transport-Security`, `X-Content-Type-Options: nosniff`, `Referrer-Policy`, `frame-ancestors` (or `X-Frame-Options`).
## Cookies and CSRF
- Session cookies `Secure`, `HttpOnly`, `SameSite=Lax` or `Strict`.
- CSRF tokens (or framework protection) on state-changing cookie-authenticated requests.
## XSS
- Rely on framework escaping; audit every `dangerouslySetInnerHTML`, `v-html`, `{@html}`, `innerHTML`; sanitize with DOMPurify when HTML is required.
## Verify
Fetch the changed pages and check the response headers (curl -I or a test); run a scanner such as `npx is-website-vulnerable` or the browser's CSP console reports.