# CSP Header Review

CSP Header Review is a tested SKILL.md that reviews ONE Content-Security-Policy header, with any note pasted beside it, and lists only the gaps that let injected script run or let the page be framed, one line each with a fixed code, the directive, why it hurts and the fix - or exactly No findings; an agent buys it once for $0.01 over x402.

- Page: https://aiskills402.com/skills/csp-header-review
- Category: Code & Engineering (https://aiskills402.com/categories/code)
- Price: $0.01 once, USD-priced, paid in USDC on Base over x402. Price as loaded on this page. The 402 response your agent receives is authoritative.
- Version: 1.0.0
- Card (JSON): https://api.aiskills402.com/v1/skills/csp-header-review

## Use it when

Reviews ONE Content-Security-Policy header, with any note pasted beside it, and lists only the gaps that let injected script run or let the page be framed, one line each with a fixed code, the directive, why it hurts and the fix - or exactly No findings. It catches unsafe-eval or unsafe-inline in the script directive, a star, a data source or a bare scheme as a script source, a policy with neither object-src nor a default-src, a missing base-uri, a missing frame-ancestors, and a report-only header that the note describes as blocking. It leaves out the safe look-alikes, such as unsafe-inline in style-src only, unsafe-inline beside a nonce, a nonce with strict-dynamic, and a data source for images. Use to review a CSP before rollout, to audit the headers of a site, or to check a policy copied from a tutorial.

## Not for

Cross-origin sharing, cookie attributes, meta-tag delivery, form-action, trusted types and report endpoints. It reads one pasted policy and judges only the directives written there; it cannot see the other headers of the response or what the page scripts do.

## Tested, honestly

Tested 2026-10-26.

- Strong model (claude-sonnet-5-5 (Claude Code alias "sonnet")): Right on all 3 cases, read by hand. On the shop policy it found the eval keyword in the script directive and the missing framing rule, and left out the inline-style allowance and the data source for images. On the admin header it named the report-only header that the ticket calls blocking and the missing base rule, and left out the inline-script keyword that sits beside a nonce and strict-dynamic. On the strict policy it answered exactly No findings.
- Weak model (claude-haiku-5-5 (Claude Code alias "haiku")): Right on all 3 cases, read by hand. It matched the strong model on both planted headers, with the same fixes, and kept the safe look-alikes out. On the strict policy it answered exactly No findings. The fixes it proposes are sound; one even offers to correct the ticket instead of the header, which fits the facts.

Note: Light test: three cases (two planted, one clean), one run per model; no comparison without the skill. The three inputs were written by us; each planted one carries a safe look-alike, and the headers carry no comment that points at the defect (the ticket sentence in the second case is the claim being checked, not a hint). Facts come from public MDN pages, read on 26 October 2026; the rule against a star or a data source as script source is our own. There are no owner-measured facts.

Full summary: https://aiskills402.com/skills/csp-header-review/tests

## Example

### English (claude-sonnet-5-5)

Before:

> Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval' https://cdn.example.com; style-src 'self' 'unsafe-inline'; img-src 'self' data:; base-uri 'self'

After:

> SCRIPT-UNSAFE — script-src 'unsafe-eval' — eval() and similar string-to-code calls stay allowed, so injected text can be turned into running script — remove 'unsafe-eval' and refactor code that needs it, or use a nonce or hash with strict-dynamic…

## What is in the file

- What the MDN pages say, as published on 26 October 2026
- The answer
- The codes
- Rules
- Work in this order
- Short example

## Languages

English

## How to buy

Agent (HTTP):

1. GET https://api.aiskills402.com/v1/skills/csp-header-review/file without a payment header. The answer is 402 with a PAYMENT-REQUIRED header (x402 v2): exact amount, asset, network, recipient.
2. Sign `accepts[0]` with an x402 client (for example @x402/core + @x402/evm).
3. Repeat the GET with the signature in the PAYMENT-SIGNATURE header. The answer is 200 with the file, its sha256 and a re-download token.

Agent (MCP): https://mcp.aiskills402.com/mcp — free tools search_skills, get_skill, redownload_skill. Buying itself is over HTTP.

Full flow: https://aiskills402.com/docs

## The file

- Version: 1.0.0
- Size: 6.0 KB (6190 bytes)
- SHA-256: bf9df88a1d4f9f18e673eaefa5963a9b442fbc90de226a42eb5f447ccdbfb025
- Updated: 2026-10-26
- New versions are free through your re-download token.

## Versions

### 1.0.0 (2026-10-26)

First release, written in the second light-test batch of 26 October 2026 (three cases, price $0.01). The idea is ours; no foreign skill was opened, facts come from the public MDN pages (see notes/ideas.md). Output: see the skill description.

Test: three cases written by hand (two planted, each with a safe look-alike, one clean control), one run on Claude Sonnet and one on Claude Haiku, no run without the skill, no iteration on the skill rules after the runs. `test/control.mjs` shows that the checks pass on the ideal answers and fail on realistic wrong ones. See `test-summary.json` for the verdicts read by hand.

## License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Terms: https://aiskills402.com/docs#license

## FAQ

### Style rules with inline styles allowed: a finding?

No. The rule for unsafe words covers the script directive only, so inline styles in style-src get no line. An inline-script keyword that sits beside a nonce is also left alone, because the MDN page says such a list is ignored once strict-dynamic is present.

### Why is a star or a data source in the script directive reported?

It is the skill's own rule. The MDN pages give no warning about those sources, so the skill states that, and lets every explicitly named host through, wildcard subdomains included.

### Which policies were used in the trial?

A policy with an eval keyword and no framing rule, a report-only header that a ticket calls blocking and that lacks a base rule, and a strict nonce policy with nothing wrong. Both models, Sonnet and Haiku, ran every policy a single time.

### How is an all-clear reported?

By the lone sentence No findings. and nothing else. A gap, by contrast, takes exactly one line: code, directive, reason, fix.

## Measurement limits

- Models other than the two named above were not run.
- Each verdict comes from the test run on the date shown; the skill may have changed since (check the version).
- Full test inputs are not published here, only short excerpts of our own text.
- Results on your own texts, languages and domains can differ.

Offer note: Paid in USDC (USD-pegged) over x402 by an AI agent; one-time.
