Skip to content
Back to skills

Web Security Headers

ASecurity

Harden web apps with CSP, HSTS, secure cookies, CSRF protection and XSS-safe rendering

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
ai-agentsapisecurity

Works with

  • api

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add ansh44233/forge --skill web-security-headers --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Web Security Headers?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Web Security Headers
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ansh44233-web-security-headers/badge)](https://www.skillsdirectory.com/skills/ansh44233-web-security-headers)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.