Code & Engineering

CORS Config Review

Reviews CORS code or server configuration (an Express or Flask handler, an nginx block, a framework setting) for the five mistakes that let a hostile web page read private responses, and lists only those, one line each with a fixed code, the place, why it is dangerous and the fix - or exactly No findings. It catches a request Origin copied into the allow header while cookies are allowed, a wildcard origin together with credentials, the null origin allowed, an origin check by suffix, substring or an unanchored pattern, and a per-origin allow header sent without Vary Origin. It leaves out the safe look-alikes, such as an exact allow-list with credentials and a public read-only API that answers with a wildcard and no credentials. Use to review CORS code before release, to audit a gateway config, or to debug a browser CORS error that looks like a server mistake.

CORS Config Review is a tested SKILL.md that reviews CORS code or server configuration (an Express or Flask handler, an nginx block, a framework setting) for the five mistakes that let a hostile web page read private responses, and lists only those, one line each with a fixed code, the place, why it is dangerous and the fix - or exactly No findings; an agent buys it once for $0.01 over x402.

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

Not for

Preflight caching, private network access, cookie flags and headers other than the cross-origin ones. It reads one pasted handler or config and judges only what is written in it.

Tested, honestly

Tested 2026-10-19 with a strong and a weak model.

SonnetStrong model, claude-sonnet-5-5
Right on all 3 cases, read by hand. On the Express handler it gave the suffix check and the missing Vary and left out the public status route. On the nginx file it gave the reflected origin in the upload location and the null entry in the map, and left out the exact allow-list. On the clean Flask handler it answered exactly No findings.
HaikuWeak model, claude-haiku-5-5
Right on 2 of 3 cases, read by hand. It was right on the nginx file and on the clean Flask handler. On the Express handler it gave the suffix check and the missing Vary but also an origin-reflected line, although a comparison exists, and a wildcard-with-credentials line for the status route. The second remark is defensible, because the global middleware sets the credentials header before that route sets the star for a matching origin, so our bait was not fully clean; the reflection line contradicts the skill definition. The check counts both as misses and it is recorded as a wrong answer.

Full test summary

Example

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

English · claude-sonnet-5-5

Before

const express = require('express'); const app = express(); app.use((req, res, next) => { const origin = req.headers.origin || ''; if (origin.endsWith('example.com')) { res.setHeader('Access-Control-Allow-Origin', origin); res.setHeader('Access-Control-Allow-Credentials', 'true'); } next(); });…

After

WEAK-ORIGIN-CHECK — global middleware, `origin.endsWith('example.com')` — a hostile site such as `evilexample.com` or `example.com.evil.com`-style lookalikes ending in `example.com` passes the check and gets credentialed read access to `/api/orders` — parse the origin and compare it against an exact list of full origins (e.g. `https://app.example.com`) or an anchored, escaped pattern…

What is in the file

  • What the MDN page says, as published on 19 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-19. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.0.0 · 2026-10-19

    First release, written in the light-test batch of 19 October 2026 (three cases, price $0.01). The idea is ours; no foreign skill was opened, facts come from public documentation (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 text 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

Star origin on a public read-only route: a finding?

Only when credentials are allowed on the same response. A public read-only route that answers with the star and sets no cookie header is a normal setup and gets no line.

Is an exact allow-list with credentials reported?

No. Copying the request origin after a match against a set of full origins, with Vary Origin sent, is the safe form and gets no line. Copying the origin with no comparison is reported as reflection.

What is the rule for the null origin?

MDN notes that the origin can be the word null and offers no rule for it. Treating null as an allowed origin on a response with credentials is therefore the own policy of this skill, and its text says so openly.

Where did the test go wrong?

An Express handler with an ends-with check and no Vary, an nginx file with a null entry and one location that copies the origin, and a clean Flask handler. Claude Sonnet was right on all three. Claude Haiku was right on two and on the Express handler added a reflection line and a wildcard line; the second is defensible because the global middleware also runs on the status route, so that bait was not clean.

Share

Read this page as Markdown: /skills/cors-config-review.md.

More in Code & Engineering

  • IAM Policy Review

    Code & Engineering

    SKILL.md · v1.0.0 · 6.2 KB

    Reviews ONE AWS IAM policy (an identity policy, or a bucket policy) written as JSON for the five grants that hand out far more than a job needs, and lists only those, one line each with a fixed code, the statement, why it is dangerous and the fix - or exactly No findings. It catches every action on every resource or a whole service on every resource, iam:PassRole on any role, Allow combined with NotAction, a public principal with no condition, and actions that let a holder raise their own rights such as creating a policy version or attaching a policy. It leaves out the safe look-alikes, such as a public principal narrowed to an organization, read-only access to one bucket, and a Deny with NotAction. Use to review a policy before attaching it, to audit a role, or to check a bucket policy for public access.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 19 Oct 2026

  • Dockerfile Review

    Code & Engineering

    SKILL.md · v1.0.0 · 6.1 KB

    Reviews ONE Dockerfile for the five build mistakes that cost security or build time, and lists only those, one line each with a fixed code, the instruction, why it hurts and the fix - or exactly No findings. It catches a final image that runs as root, a base image with no tag or the latest tag, a secret passed through an argument, an environment value or a file copy so that it stays in the image history, source copied in before the dependencies are installed so the cache is lost on every edit, and the package index left in the layer after apt-get. It leaves out the safe look-alikes, such as a build secret mounted for one instruction, a tag pinned by digest, and root in a build stage that never ships. Use to review a Dockerfile before merging, to audit the images of a repository, or to speed up a slow image build.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 19 Oct 2026

  • CodeTour File Builder

    Code & Engineering

    SKILL.md · v1.0.0 · 5.2 KB

    Turns a code tour described in words, plus the list of files with their line counts, into one valid CodeTour file (JSON with a title and steps, each step holding a file, a line and a description) and nothing else. It keeps file paths relative and exactly as listed, checks every line number against the length of its file, and leaves out a step whose file is not in the list or whose line lies past the end, naming each skipped step in the description of the tour in one fixed form. A tour with only valid steps carries no mention of skipping. Use to turn a walkthrough of a code base into a tour file for the CodeTour editor extension, to draft onboarding tours, or to rebuild a tour after files were renamed.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 19 Oct 2026

  • HTML Email Compatibility Review

    Code & Engineering

    SKILL.md · v1.0.0 · 7.4 KB

    Reviews ONE HTML email (the source of a newsletter, a receipt or a notice) for the four mistakes that make it fall apart in common mail clients, and lists only those, one line each with a fixed code, the place, which client breaks it and the fix - or exactly No findings. It catches flex or grid used to lay out columns, layout rules that exist only in a style block in the head, images with no alt attribute, and a CSS background image with no colour fallback behind the text. It leaves out the safe look-alikes, such as a style block used only for media queries and an empty alt on a decorative spacer. Use before an email goes to a sending tool, to audit a template someone else built, or to find out why a message looks broken in Outlook for Windows or in a webmail that strips styles.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 19 Oct 2026