Skip to content
Skillpedia
Security35k · #6139

performing-security-headers-audit

Teaches your AI agent to protect apps against attacks.

What it does

This tool checks if a website is using important browser-level security protections. It analyzes the website's response 'headers' to ensure sensitive information isn't exposed and the site is guarded against common attacks.

When to use it

  • ✓When checking the security of a website you have permission to test.
  • ✓When you want to ensure the user's browser is protected against data theft or attacks.
  • ✓To confirm if a website meets specific security requirements.

Example of what to ask your AI

“Audit the security headers for example.com”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-security-headers-audit/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-security-headers-audit/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool fetches responses from a website and examines the security headers it sends back. It checks if settings like 'Content Security Policy' and 'HTTP Strict Transport Security' are active and correctly configured to protect the user.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill performing-security-headers-audit

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/performing-security-headers-audit/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Performing Security Headers Audit

When to Use

  • During authorized web application security assessments as a standard configuration review
  • When evaluating browser-level protections against XSS, clickjacking, and data leakage
  • For compliance assessments requiring security header implementation (PCI DSS, SOC 2)
  • When performing initial reconnaissance to identify easy-win security improvements
  • During CI/CD pipeline security gate checks for new deployments

Prerequisites

  • Authorization: Written scope for the target application (header review is low-risk)
  • curl: For fetching response headers from target endpoints
  • SecurityHeaders.com: Online scanner for quick header assessment
  • Mozilla Observatory: Mozilla's web security testing tool
  • Burp Suite: For comprehensive header analysis across multiple pages
  • Browser DevTools: For examining headers and CSP violations in real-time

Workflow

Step 1: Collect Security Headers from Target

Retrieve and catalog all security-related response headers.

# Fetch all response headers
curl -s -I "https://target.example.com/" | grep -iE \
  "(strict-transport|content-security|x-frame|x-content-type|x-xss|referrer-policy|permissions-policy|feature-policy|x-permitted|cross-origin|set-cookie|server|x-powered-by|cache-control)"

# Check headers across multiple pages
PAGES=("/" "/login" "/api/health" "/admin" "/account/settings" "/static/app.js")

for page in "${PAGES[@]}"; do
  echo "=== $page ==="
  curl -s -I "https://target.example.com$page" 2>/dev/null | grep -iE \
    "(strict-transport|content-security|x-frame|x-content-type|x-xss|referrer-policy|permissions-policy|set-cookie|server|x-powered)"
  echo
done

# Check both HTTP and HTTPS responses
echo "=== HTTP Response ==="
curl -s -I "http://target.example.com/" | head -20
echo "=== HTTPS Response ==="
curl -s -I "https://target.example.com/" | head -20

Step 2: Assess Transport Security (HSTS)

Evaluate HTTP Strict Transport Security configuration.

# Check HSTS header
curl -s -I "https://target.example.com/" | grep -i "strict-transport-security"

# Expected: Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

# Verify HSTS attributes:
# max-age: Should be >= 31536000 (1 year) for preload eligibility
# includeSubDomains: Protects all subdomains
# preload: Eligible for browser HSTS preload list

# Check if HTTP redirects to HTTPS
curl -s -I "http://target.example.com/" | head -5
# Should be 301/302 redirect to https://

# Check if HSTS is on the preload list
# Visit: https://hstspreload.org/?domain=target.example.com

# Test for HTTPS-only cookies
curl -s -I "https://target.example.com/login" | grep -i "set-cookie"
# All session cookies should have Secure flag

# Check for mixed content
curl -s "https://target.example.com/" | grep -oP "http://[^\"']+" | head -20
# HTTP resources loaded on HTTPS pages create mixed content vulnerabilities

Step 3: Audit Content Security Policy (CSP)

Analyze CSP headers for effectiveness and potential bypasses.

# Extract CSP header
CSP=$(curl -s -I "https://target.example.com/" | grep -i "content-security-policy" | cut -d: -f2-)
echo "$CSP"

# Check for dangerous directives:
# 'unsafe-inline' in script-src: Allows inline scripts (XSS risk)
# 'unsafe-eval' in script-src: Allows eval() (XSS risk)
# * in any directive: Allows loading from any origin
# data: in script-src: Allows data: URI scripts
# Missing default-src: No fallback policy

echo "$CSP" | tr ';' '\n' | while read directive; do
  echo "  $directive"
  if echo "$directive" | grep -q "unsafe-inline"; then
    echo "    WARNING: unsafe-inline allows inline script execution"
  fi
  if echo "$directive" | grep -q "unsafe-eval"; then
    echo "    WARNING: unsafe-eval allows eval() calls"
  fi
  if echo "$directive" | grep -q " \* "; then
    echo "    WARNING: wildcard allows loading from any origin"
  fi
done

# Check for CSP report-only (not enforcing)
curl -s -I "https://target.example.com/" | grep -i "content-security-policy-report-only"
# Report-only does NOT block violations, only logs them

# Test CSP with Google's evaluator
# https://csp-evaluator.withgoogle.com/
# Paste the CSP header for automated analysis

# Check for CSP bypass via whitelisted domains
# If CDN domains are whitelisted, check for JSONP endpoints or angular libraries

Step 4: Check Frame Protection and Click Defense Headers

…

FAQ

What are 'security headers'?

These are extra pieces of information sent by a website to the browser, instructing it on how to handle content securely, like preventing the loading of scripts from untrusted sources or ensuring the connection is always HTTPS.

Do I need permission to use this tool?

Yes, you must have explicit authorization to audit a website's security. Testing without permission can be illegal.

What kind of issues can this tool find?

It can identify misconfigurations that leave a website vulnerable to attacks like Cross-Site Scripting (XSS), clickjacking, data leakage, and a lack of proper encryption for connections.

Details

Original description by the author

Auditing HTTP security headers including CSP, HSTS, X-Frame-Options, and cookie attributes to identify missing or misconfigured browser-level protections.

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#6139
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills