http-headers-security
Skill1 starsChanged 10 days agoMITView on GitHub
Audit HTTP security headers on every in-scope web endpoint. Covers CSP, HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, COOP, COEP, CORP, Cache-Control (sensitive pages), and deprecated/redundant headers (X-XSS-Protection). Run after tech fingerprinting and before xss/clickjacking — missing headers widen the attack surface for those vulns.
In this repository124 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ai-agent-reconSkill
- ai-supply-chainSkill
- exfiltration-via-aiSkill
- indirect-injectionSkill
- llm-fuzzingSkill
- prompt-injectionSkill
- rag-poisoningSkill
- tool-abuseSkill
- chain-analysisSkill
- chain-auth-to-takeoverSkill
- chain-customSkill
- chain-graph-walkSkill
- chain-idor-to-mass-dataSkill
- chain-info-to-exploitSkill
- chain-multi-appSkill
- chain-ssrf-to-cloudSkill
- chain-web-to-rceSkill
- chain-xss-to-account-takeoverSkill
- email-securitySkill
- engagement-flowSkill
- finding-disciplineSkill
- oob-interactionsSkill
- opsec-disciplineSkill
- research-firstSkill
- scope-disciplineSkill
- scope-importSkill
- session-contextSkill
- 2fa-bypassSkill
- api-abuseSkill
- auth-bypassSkill
- broken-access-controlSkill
- business-logicSkill
- cache-poisoningSkill
- clickjackingSkill
- corsSkill
- credential-testingSkill
- crlf-injectionSkill
- cryptographic-oracleSkill
- csrfSkill
- css-injectionSkill
- data-exfiltration-testSkill
- deserializationSkill
- email-injectionSkill
- file-uploadSkill
- fuzzingSkill
- graphqlSkill
- grpcSkill
- host-headerSkill
- http-smugglingSkill
- idorSkill
- info-disclosureSkill
- jwtSkill
- lateral-movementSkill
- lfi-rfiSkill
- mass-assignmentSkill
- oauthSkill
- open-redirectSkill
- parameter-pollutionSkill
- password-resetSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
After identifying the tech stack — some headers are framework-specific.
- Distinctive: line 23
When building the attack surface for XSS, clickjacking, or CSRF.
- Distinctive: line 94
Check: camera, microphone, geolocation, payment, usb
- Distinctive: line 127
Remove or genericize in production
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Signals
- Any web endpoint in scope (HTML pages, API endpoints, login/logout flows).
- After identifying the tech stack — some headers are framework-specific.
- When building the attack surface for XSS, clickjacking, or CSRF.
Prerequisites
- List of in-scope URLs (at least: homepage, login, authenticated page, API base).
- Tech stack fingerprint (framework defaults differ).
Methodology
1. Collect headers from key pages
# Grab headers from multiple representative pages
for url in "$TARGET" "$TARGET/login" "$TARGET/api/v1" "$TARGET/dashboard"; do
echo "=== $url ==="
curl -sI -o /dev/null -D - "$url" 2>/dev/null | grep -iE "^(strict|content-sec|x-frame|x-content|referrer|permissions|cross-origin|cache-control|x-xss|set-cookie|server|x-powered)"
echo
done2. Check each header
Content-Security-Policy (CSP)
curl -sI "$TARGET" | grep -i "content-security-policy"- Missing entirely → Medium (enables XSS exploitation)
unsafe-inlinein script-src → weakens CSP significantlyunsafe-evalin script-src → allows eval-based XSS*or overly broad domains in script-src → 3rd party injection- No
frame-ancestors→ clickjacking (if X-Frame-Options also absent) report-uri/report-topresent → note for evasion awareness
Strict-Transport-Security (HSTS)
curl -sI "https://$TARGET" | grep -i "strict-transport-security"- Missing → Medium (SSL stripping possible)
max-age< 31536000 (1 year) → Low (short HSTS window)- No
includeSubDomains→ subdomains vulnerable to stripping - No
preload→ not in browser preload list (informational) - Present on HTTP (not HTTPS) → misconfiguration, browser ignores it
X-Frame-Options
curl -sI "$TARGET" | grep -i "x-frame-options"- Missing (and no CSP frame-ancestors) → Medium (clickjacking)
ALLOW-FROM→ deprecated, not supported by modern browsersSAMEORIGINorDENY→ correct
X-Content-Type-Options
curl -sI "$TARGET" | grep -i "x-content-type-options"- Missing → Low (MIME-sniffing attacks)
- Expected:
nosniff
Referrer-Policy
curl -sI "$TARGET" | grep -i "referrer-policy"- Missing → Low (tokens/sensitive paths leaked in Referer header)
unsafe-urlorno-referrer-when-downgrade→ leaks full URLstrict-origin-when-cross-originorno-referrer→ correct
Permissions-Policy (formerly Feature-Policy)
curl -sI "$TARGET" | grep -iE "permissions-policy|feature-policy"- Missing → Informational (browser features unrestricted)
- Check: camera, microphone, geolocation, payment, usb
Cross-Origin headers (COOP/COEP/CORP)
curl -sI "$TARGET" | grep -i "cross-origin"Cross-Origin-Opener-Policy→ protects against Spectre-like leaksCross-Origin-Embedder-Policy→ required for SharedArrayBufferCross-Origin-Resource-Policy→ prevents cross-origin reads
Cache-Control on sensitive pages
curl -sI "$TARGET/dashboard" | grep -i "cache-control"
curl -sI "$TARGET/api/v1/user/profile" | grep -i "cache-control"- Sensitive pages without
no-store→ Medium (cached credentials/PII) - API responses with PII without
private, no-store→ Medium
Set-Cookie flags
curl -sI "$TARGET/login" -X POST -d "user=test&pass=test" | grep -i "set-cookie"- Missing
Secureflag → cookie sent over HTTP - Missing
HttpOnlyflag → cookie accessible to JS (XSS → session theft) - Missing
SameSite→ CSRF vector (unless CSRF tokens used) SameSite=NonewithoutSecure→ browser rejects it
Information leakage headers
curl -sI "$TARGET" | grep -iE "^(server|x-powered-by|x-aspnet|x-generator)"Server: Apache/2.4.51→ version disclosureX-Powered-By: PHP/8.1.2→ version disclosure- Remove or genericize in production
3. Batch check with httpx (fast)
echo "$TARGET" | httpx -silent -status-code -title \
-H "Strict-Transport-Security" \
-H "Content-Security-Policy" \
-H "X-Frame-Options" \
-H "X-Content-Type-Options" \
-json -o headers-audit.json4. Automated check with securityheaders.com
# Quick reference — compare against manual findings
curl -s "https://securityheaders.com/?q=$TARGET&followRedirects=on" \
| grep -oP 'class="[A-F](-\w+)?"' | head -15. Nuclei scan for header misconfigurations
nuclei -u "$TARGET" -t http/misconfiguration/ \
-t http/exposed-panels/ \
-tags header,security-headers,misconfig \
-json -o nuclei-headers.jsonSeverity Mapping
| Missing/Misconfigured | Severity | Condition |
| CSP missing entirely | Medium | Especially if XSS found |
| CSP with unsafe-inline + unsafe-eval | Low-Medium | Weakens but not absent |
| HSTS missing | Medium | HTTPS available but no HSTS |
| X-Frame-Options + CSP frame-ancestors both missing | Medium | Clickjacking possible |
| X-Content-Type-Options missing | Low | |
| Set-Cookie without Secure/HttpOnly | Medium | On session cookies |
| Set-Cookie SameSite=None | Low-Medium | Without CSRF tokens |
| Cache-Control missing on sensitive pages | Medium | Pages with PII/auth |
| Referrer-Policy missing/unsafe | Low | |
| Permissions-Policy missing | Informational | |
| Server/X-Powered-By version disclosure | Informational | |
| COOP/COEP/CORP missing | Informational | Unless Spectre-class concern |
Validation Gate
- Headers collected from at least: homepage, login, one authenticated page, one API endpoint.
- Each header checked individually — not just a single automated scan grade.
- Missing headers that enable other attacks (CSP → XSS, X-Frame-Options → clickjacking) cross-referenced with those hunt skills.
- Set-Cookie flags checked on actual session cookies, not just any cookie.
- Cache-Control checked specifically on pages containing PII or auth tokens.
Gotchas
- A grade from securityheaders.com is not a finding — it's a starting point. Report specific missing headers with specific impact.
- CSP
report-onlymode does not actually block anything — it's monitoring only. X-XSS-Protectionis deprecated and can actually introduce vulnerabilities in some browsers (filter-based XSS). Don't recommend enabling it; if present, note as informational.- Some frameworks set headers by default (Django's SecurityMiddleware, Rails' default_headers) — check if they're being overridden or stripped by a reverse proxy.
- API-only endpoints may legitimately skip some headers (X-Frame-Options irrelevant for JSON APIs).
- CDN/reverse proxy (Cloudflare, nginx) may add or strip headers — test against the origin if possible.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

