Skip to content
Back to skills

Api Security Review

ASecurity

Read-only security audit of a repo's API and web app; each finding comes with path:line, trace and fix. Looks for SQL injection (queries built from strings), endpoints with no auth or no per-object authorization, endpoints, login or OTP with no rate limiting, user input that gets executed (eval, shell) or rendered unescaped (XSS), overly open CORS, badly validated JWT, OAuth or 2FA, API keys in the frontend and passwords with a fast hash. Reports, and applies only what the user picks. Use it ...

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 17, 2026
developmentrustgophpshellsqlexpressfastapidjangorailsdocker

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 17, 2026

npx -y skills add OmarAlex24/audit-skills --skill api-security-review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Security Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Api Security Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/omaralex24-api-security-review/badge)](https://www.skillsdirectory.com/skills/omaralex24-api-security-review)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: api-security-review
description: Read-only security audit of a repo's API and web app; each finding comes with path:line, trace and fix. Looks for SQL injection (queries built from strings), endpoints with no auth or no per-object authorization, endpoints, login or OTP with no rate limiting, user input that gets executed (eval, shell) or rendered unescaped (XSS), overly open CORS, badly validated JWT, OAuth or 2FA, API keys in the frontend and passwords with a fast hash. Reports, and applies only what the user picks. Use it for "audit my API security", "check for SQLi or XSS", "is my CORS config safe", "find unauthenticated endpoints", "does my login need a rate limit?", "am I storing passwords right?", or the OWASP API Top 10, even without the word "security". Not for reviewing only the pending diff (use security-review), pentesting against a server, or sizing a rate limiter (perf-diagnosis). Also triggers on Spanish requests such as "revisa la seguridad de mi API", "busca SQL injection", "¿hay endpoints sin auth?" or "¿mi CORS está bien?".
---

# API security review

This skill is a procedure for walking the code of an API or web app and finding the holes an attacker exploits without special tools: a query that pastes in the user's input, a route that answers without asking for credentials, a login that accepts unlimited attempts, a comment the browser runs as HTML, a CORS setup that lets any site read the responses. Each finding is a trace in the code, from the input to the damage, with `path:line` at each step. "There could be" is not a finding.

It covers seven classes of problem, all taken from Arjay McCandless's videos and completed with established practice (see [references/sources.md](references/sources.md); the cases from the videos, solved, are in [references/examples.md](references/examples.md)). It is not a full audit. These stay out, and the report says so:
- the dependency audit (only the version pinned in the repo is compared against a concrete official advisory, class 7);
- network and infrastructure;
- cryptography in general, except how passwords are stored;
- the rest of the OWASP API Top 10.

Write the report in the user's language.

## Non-negotiable rules

- **Read-only.** Phases 0 to 4 modify nothing: no code, no git, no dependencies, no files beyond what the user asks for. Do not run tests, builds, migrations or `dev` servers during the audit.
- **No requests to servers.** Not production, not staging, not `localhost`, even if one is running. The evidence is the code, the config and the schema. Local computations on repo data are fine; for example, hashing a documented key to see whether it matches the seeded one. Active probes (a quote in a parameter, a route with no token, a foreign `Origin`) go in the report as "optional verification", and run only if the user asks, against the environment the user names.
- **Databases.** If you need to query permissions or data (grants, columns with secrets), do not do it yourself: propose the query, say which environment it would point to according to the config and wait for confirmation. Never write.
- **Do not use or repeat secrets.** If you find a key in the repo, cite `path:line` and the first 4 characters; do not copy it whole or test it. This also applies to "development" keys already in the README: the report may end up in a ticket or a chat.
- **Report first, apply only with approval** (phase 5).
- **Each topic in its own skill.** Measuring latency, load or the size of a rate limiter belongs to `perf-diagnosis`; transactions, idempotency and consistency, to `data-consistency`; system design (requirements, data, APIs, availability), to `architecture-review`; a `status` written from many places, to `implicit-state-machines`; a formula, a bound, a condition, a parsing or a default value that gives a wrong result, to `correctness-review`; module or layer boundaries that are not respected, dependency cycles, the same problem solved several ways, god-modules, unused code or packages and docs or ADRs that contradict the code, to `code-structure`; IaC, environments, Docker and compose, K8s, CI/CD, deploy, config and secrets management, backups and restore, monitoring and alarms, platform limits, infrastructure SPOFs, pinned versions and infra cost, to `infra-review`. Of the infrastructure, only the security detail belongs here: an exposed secret, an excess permission, an open port. Outside text that reaches an LLM's prompt (prompt injection), model tools with excess permissions and model output used without validation belong to `llm-app-review`; if that output reaches a sink (SQL, shell, HTML, `eval`), the sink detail belongs here and treating the output as trusted belongs there. When a signal falls in another skill, note it under "Not covered" with the skill it goes to and do not develop it.

## Phase 0: scope and context

1. Use the scope the user gave. In a monorepo with no hint, ask which app or package to audit.
2. Read AGENTS.md, CLAUDE.md, SECURITY.md, the README and the architecture and API docs. That is usually where the auth model is, which routes are public on purpose, what an external gateway protects and the table of routes with their permissions, which you will cross-check against the code in phase 1.
3. The scope is not just `src/`. It includes migrations, seeds, fixtures, the deploy config and the scripts in `package.json`, `Makefile` or similar: a seeded credential that reaches production does not show up on any route.
4. Identify the stack (HTTP framework, DB driver or ORM, template engine or frontend framework, platform: Express, Hono/Workers, FastAPI, Django, Rails, axum, Go net/http, API Gateway…) and which layers live outside the repo (gateway, WAF, CDN, proxy). What lives outside cannot be confirmed from the code: findings that depend on it are **Likely**.

## Phase 1: inventory of the surface

Build a table with **every** input, not just the HTTP routes:

```text
method | route | handler path:line | auth (what and where) | authorization (permission/owner) | limit (which key) | CORS | input it accepts
```

Include webhooks, queue consumers, crons, admin endpoints, `/internal/*`, health checks, GraphQL and server actions. Follow the real middlewares: an `app.use(auth)` registered after a route does not protect it; a router mounted separately may not inherit it. The commands to find routes per framework are in [references/signals.md](references/signals.md#inventory).

If the docs bring a table of routes, cross-check each row: a documented permission the code does not enforce, or a route that exists in the code and not in the docs, is a candidate. Also note whether the limiter runs before or after auth. The auth, authorization and rate limiting findings come straight out of this table. A route that is public on purpose (`/health`, login, sign-up, public content) is marked as such with its reason; it is not a finding, but it does need a limit if it is expensive or guessable.

## Phase 2: search by class

Read [references/signals.md](references/signals.md) and go through the classes in this order; each one has sinks per stack, `rg` commands and how to rule out false positives.

1. **Auth and authorization**:
   - routes with no auth or no deny-by-default;
   - per-object authorization: an `id` from the URL or the body that is not checked against the authenticated user, including a client id used as an upsert key;
   - broad permissions, or permissions documented but not enforced;
   - API keys used as the only control;
   - default credentials in seeds that a script applies remotely;
   - JWT without checking `exp`/`aud`/`iss` or with the key in the repo;
   - OAuth without validating the provider's token;
   - 2FA/TOTP with no attempt limit or with the secret in plain text;
   - third-party keys in the frontend bundle;
   - passwords stored with a fast hash (MD5, SHA-1, plain SHA-256), with no salt or a fixed salt, with a low cost or with reversible encryption, and hashes recomputed and compared with `==` instead of with the library's function. Follow every write to the password column, seeds included. A SHA-256 over an API key or a random token is correct.
2. **Rate limiting as a defense**:
   - endpoints with no limit, especially login, OTP, password reset, sign-up, and whatever costs money or CPU;
   - a limiter that runs after auth and leaves invalid requests unlimited;
   - the limit's key: identity or the real IP behind the proxy;
   - state shared across instances and atomicity;
   - what happens if the limit's store fails;
   - body size and pagination with no cap;
   - caps the API announces (`max_cost`, `max_tokens`) that no code enforces.
3. **SQL injection**:
   - queries built with template strings, `+`, `format!`, `fmt.Sprintf`, f-strings or an ORM's `raw`/`unsafe` methods, with a value that comes from the request; start from the full list of sinks and read each one;
   - identifiers (`ORDER BY`, a column or table name) that cannot be parameterized.
4. **Executing user input**: `eval`, `new Function`, `vm`, shell (`exec`, `shell=True`, `system`/`shell_exec` in PHP), PHP `include`/`require` with a value from the request, templates compiled from input, unsafe deserialization (`unserialize` included).
5. **XSS**: input rendered as HTML (`innerHTML`, `dangerouslySetInnerHTML`, `v-html`, `|safe`, `html_safe`, `{!! !!}`, autoescape turned off), and the defenses that reduce the damage (`HttpOnly` cookies, CSP).
6. **CORS**: `*` on authenticated routes, origin reflected with no list, `credentials: true` with a reflected origin, regexes or `endsWith` that accept foreign domains, the `null` origin allowed, a header duplicated between gateway and app.
7. **Runtime and dependencies with a known vulnerability**: the version the repo pins (base image, `.tool-versions`, lockfile) against the fixed versions in an official advisory, like the PHP2Shell one. The app's code can be fine and the runtime not. A floating tag or a distro package is Likely. `composer audit`, `npm audit` and the like query the network: they are optional verification.

**Source → sink.** A signal is not a finding. For injection, execution and XSS, trace the value from the input (`req.query`, body, header, a DB row written by a user) to the sink, with `path:line` at each hop. If the interpolated value is a constant, a validated enum or a generated placeholder (`?, ?, ?`), rule it out and count it.

**Large repos** (more than ~30 route files or ~10,000 lines in scope): if you can launch subagents, split by class or by module across read-only subagents (Explore type), with the path to `references/signals.md` and this format per candidate: `path:line | class | source | sink | why it could be a false positive`. They only find; you verify by reading the code.

## Phase 3: confirm and try to rule out

For each candidate:

1. **Trace** from input to impact, with `path:line` read (not from memory).
2. **Try to rule it out**: a global middleware, prior validation (a schema that limits to an enum or a number), the engine's automatic escaping, a documented gateway or WAF, a route that is not registered, dead code, tests that exercise the defense.
3. **Confidence**:
   - **Confirmed**: you traced every step in the repo's code.
   - **Likely**: a step depends on something outside the repo (gateway config, a dashboard, an environment variable, the library version). Name it and say how to confirm it, including the optional probe.
   - **Smell**: not exploitable today, but the defense depends on a convention or on a single point (for example, an interpolated query with a value that is constant today).
4. **Severity** (the template's common scale, applied to security): Critical (reading or writing other people's data, code execution, account takeover with no preconditions), High (the same with some precondition or limited reach), Medium (resource or cost abuse, bounded brute force, metadata exposure), Low (missing defense in depth). Justify it with the concrete impact in this app.
5. **Fix**: the lightest one that removes the defect, then the heavier ones. Catalog in [references/fixes.md](references/fixes.md). For each one: the change, the risk of breaking something (legitimate clients that depend on the current behavior, origins that work today, persisted values) and the test that proves it.

If there are at least three Confirmed or Likely findings and you can launch subagents, ask an independent reviewer to try to rule out each one: give it the findings and the paths, not your reasoning. If you cannot (for example, because you are a subagent), make an adversarial pass yourself and mark it "no independent review".

## Phase 4: report and stop

Write the report in the chat with [references/report-template.md](references/report-template.md): summary, inventory of the surface, findings table, one block per finding, counted rule-outs, what was not covered and questions. Save it to a file only if the user asks.

End by asking which findings to apply, with your recommended order (severity and effort). **Then stop.**

## Phase 5: apply (only what the user picked)

1. Confirm in one line what you are going to apply.
2. For each finding: write the test first (the query with `' OR '1'='1` is treated as data, the route with no token answers 401, the foreign origin does not get `Access-Control-Allow-Origin`, the sixth OTP attempt gets 429, the `<script>` comes out escaped, two users with the same password have different hashes), watch it fail, fix and watch it pass. The tests run in the project's test harness, not against a deployed server.
3. Run the project's checks (lint, typecheck, tests) and report each command with its result. If a test touches a database, say first which environment it points to.
4. No commits, push or PRs unless asked. CORS or limit changes that could cut off legitimate clients are flagged before applying.

## Common mistakes

- Reporting every `query(` with a template string without tracing where the value comes from.
- Accepting a route because "the frontend does not call it" or because "it is behind the gateway" without looking at the gateway config.
- Treating an API key as user authentication, or a rate limit as closing a risk: they reduce it, they do not remove it.
- Proposing `Access-Control-Allow-Origin: *` to "fix" a CORS error, or believing that CORS protects the API from `curl`.
- Escaping on save and on display (double escaping), or sanitizing with home-made regexes.
- Sending a request "just to confirm".
- Staying on the routes. Seeds, fixtures, deploy scripts and docs are also surface: a seeded development credential that a script applies remotely does not show up on any route.
- Reporting every `sha256(` as a badly stored password. Hashing an API key or a random token with SHA-256 is correct.
- Calling a runtime vulnerable because of the range in `composer.json` or a floating tag: that says what the app accepts, not which version runs.

## Swarm mode

It turns on when the invocation brings a swarm brief (between `[swarm brief]` and `[end of brief]`), with `contract:`, `map:`, `structure:`, `output:` and `data:`. Used on its own, the skill follows the procedure above unchanged, report included. In this mode:

- **Phases:** follow phases 0 to 3, with the fix, its risk and its test from phase 3; you apply nothing. The brief's map replaces reading the docs and the stack in phase 0, but read what the map points to and whatever it is missing.
- **No questions and no waiting:** what you would ask the user goes to the `questions` field; you do not stop to wait for an answer.
- **No subagents or reviewers:** the swarm does the independent verification. This overrides the large-repo rule in phase 2 and the independent reviewer in phase 3. Make the pass that tries to rule out each finding yourself, prioritize by the map's hot paths and declare in `not_covered` what you did not cover.
- **Data:** only the `data:` command. You never open connections, tunnels or scripts of your own, and you do not read `.env` looking for credentials. If `data:` is "none", what you would have measured goes to `requested_measurements`. It is for grants, roles and which columns exist, never for reading values; the rule of not sending requests to servers still holds.
- **Slice:** if the brief brings `slice:`, you only report findings whose main location (`locations[0]`) is in that slice; the membership rule is in the brief and other auditors of this same skill have the other slices. You may open files outside it only to follow a sequence that starts in your slice, and each one goes to `outside_slice` with the reason. A defect that starts outside is not yours: at most, one line in `not_covered` with its path:line. The slice section (`slice map:`) completes the global map. What the brief marks in `exclude:` belongs to no slice: you do not audit it, do not cite it as evidence and do not report anything whose main location falls there; you may open it only to understand a call that leaves the scope, and then it goes to `outside_slice` with the reason.
- **Limits:** you do not modify the audited repo and you do not read other audit runs or other auditors' folders, except what the brief gives you: contract, map, `structure:` and your folder.
- **Metric:** fill `metric` in each finding per `before-after.md` (next to the contract the brief gives), with this skill's row of its "Guide per skill" as the hint: the response code and body of the exploit request against the local app, or the endpoints without auth or rate limit counted by a script. A metric is a command that is run again, never a count of findings, and you do not invent its result: `{not_measurable: "<why>"}` is valid.
- **Output:** a single file, `findings.json`, in the folder the brief gives (`your folder:`), with the contract's object, and that same object as your answer. In swarm mode you write no readable report and no other file: the report template is for normal mode and the swarm's plan comes from the `findings.json` files. Use the contract's vocabulary: confidence, method, severity, effort and action.

Files in this skill

  • SKILL.md17.7 KB
  • references/examples.md9.6 KB
  • references/fixes.md13.9 KB
  • references/report-template.md3.5 KB
  • references/signals.md39.1 KB
  • references/sources.md11.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.