Code & Engineering

CSP Header Review

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.

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.

Tested 2026-10-26No code, no hidden instructionsv1.0.0 · 6.0 KB · perpetual license

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 with a strong and a weak model.

SonnetStrong model, claude-sonnet-5-5
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.
HaikuWeak model, claude-haiku-5-5
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.

Full test summary

Example

Our own test text, before and after the skill ran. Excerpts only.

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. Tried in: English.

License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.

Versions

Current version 1.0.0, updated 2026-10-26. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.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.

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.

Share

Read this page as Markdown: /skills/csp-header-review.md.

More in Code & Engineering

  • Cookie Attributes Review

    Code & Engineering

    SKILL.md · v1.0.0 · 5.9 KB

    Reviews the Set-Cookie headers of a response, or the code that sets them, and lists only the attribute mistakes that expose a login cookie, one line each with a fixed code, the cookie, why it hurts and the fix - or exactly No findings. It catches a session cookie sent without Secure, a session cookie that script can read because HttpOnly is missing, SameSite=None without Secure, a __Host- cookie that carries a Domain or a Path other than the root, a Domain attribute wider than the host that needs the cookie, and a login cookie that lives for months. It leaves out the safe look-alikes, such as a theme or language cookie that script reads, a missing SameSite attribute, and SameSite=None together with Secure. Use to review the cookies of a login flow, to audit a framework's cookie settings, or before a security review of a web app.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 26 Oct 2026

  • OAuth Redirect Flow Review

    Code & Engineering

    SKILL.md · v1.0.0 · 7.0 KB

    Reviews ONE OAuth 2.0 or OpenID Connect sign-in flow written in code for the four mistakes that let an attacker steal a login or a token, and lists only those, one line each with a fixed code, the function, why it hurts and the fix - or exactly No findings. It catches a state value that is never compared or not tied to the user's session, a browser or mobile client that sends no PKCE challenge, a redirect address matched by prefix or substring, and an implicit flow or an access token carried in a URL. It leaves out the safe look-alikes, such as a state kept in a cookie and compared, an exact redirect match, a server-side client with a secret, and a token sent in a header. Use to review a login integration, to audit a single-page app before launch, or to check a gateway that handles redirects.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 26 Oct 2026

  • PostgreSQL Migration Lock Review

    Code & Engineering

    SKILL.md · v1.0.0 · 6.9 KB

    Reviews ONE PostgreSQL migration file for the four statements that lock or rewrite a table that is already in use, and lists only those, one line each with a fixed code, the statement, why it hurts and the fix - or exactly No findings. It catches CREATE INDEX without CONCURRENTLY on an existing table, a not-null or constraint check run in one blocking step, a column type change or volatile default that rewrites the table, and a drop or rename of a column that running code may still read. It leaves out the safe look-alikes, such as an index built concurrently, a column added with a constant default, a constraint added NOT VALID and validated separately, and the drop of a column the file says nothing reads. Use to review a migration before deploy, to plan a zero-downtime change, or to check a schema pull request.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 26 Oct 2026

  • JWT Verification Review

    Code & Engineering

    SKILL.md · v1.0.0 · 6.6 KB

    Reviews ONE piece of code that verifies JSON Web Tokens for the five mistakes that let a forged or stale token in, and lists only those, one line each with a fixed code, the function, why it hurts and the fix - or exactly No findings. It catches an algorithm taken from the token header or no fixed algorithm list, an expiry check switched off, neither audience nor issuer checked, a payload read with decode where verify is needed, and a signing secret written into the source. It leaves out the safe look-alikes, such as an algorithm list fixed in the verify call, an audience compared in a second step, and a decode that only reads the key id. Use to review login middleware, to audit token handling in a service, or to check an API before release.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 26 Oct 2026