К основному содержанию
скилл CX Codex

owasp-audit — скилл аудита кода по OWASP Top 10:2025 для Claude Code

Скилл owasp-audit проверяет исходники по десяти категориям OWASP Top 10:2025. Его включают для аудита репозитория, PR или отдельного файла перед слиянием.

MIT 778 установок ★ 527 обновлён 2026-10-27

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add briiirussell/cybersecurity-skills --skill owasp-audit -a claude-code
Открыть на GitHub

Что делает owasp-audit

Скилл проводит разбор кода по десяти категориям OWASP Top 10:2025: от сломанного контроля доступа и SSRF до ошибок обработки исключений. Работает в трёх режимах: быстрый ответ на вопрос, полный аудит репозитория и проверка изменений в PR или диапазоне коммитов. Всё записывается в security-audit/ в корне репозитория.

Перед поиском уязвимостей скилл строит карту системы: определяет субъектов с разным уровнем доверия, входные поверхности (роуты, резолверы, вебхуки, джобы) и стоки (сырые SQL-запросы, exec, файловая система, исходящие HTTP-запросы). Каждый кандидат на уязвимость проходит независимую проверку: отдельный верификатор перечитывает указанные file:line и выносит один вердикт. Отчёт рендерится из findings.json.

Для больших кодовых баз хант делится по изолированным субагентам, а покрытие ведётся в coverage.json по схеме «поверхность × граница доверия × категория OWASP». Запускать аудит стоит только на коде, который вы владеете или уполномочены проверять: живые проверки вроде curl -I против развёрнутого хоста требуют того же разрешения и остаются неразрушающими. Инструменты ограничены чтением, grep и запуском npm audit.

Какие задачи решает

  • провести аудит кодовой базы по OWASP Top 10:2025
  • проверить PR или диапазон коммитов на уязвимости до слияния
  • отличить подтверждённые находки от заметок по укреплению защиты
  • зафиксировать, какие поверхности кода реально прочитаны
  • собрать отчёт findings.json для дальнейшего разбора находок

Примеры запросов агенту

  • Проведи полный аудит репозитория по OWASP Top 10, профиль standard
  • Проверь PR на уязвимости из OWASP Top 10:2025
  • Где в этом файле возможен IDOR?

Как установить owasp-audit

1Через Skills CLI (Vercel)

npx skills add briiirussell/cybersecurity-skills --skill owasp-audit -a claude-code

2Вручную: положить файлы

~/.claude/skills/owasp-audit/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/owasp-audit/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы об owasp-audit

Как установить owasp-audit в Claude Code?

Выполните npx skills add briiirussell/cybersecurity-skills --skill owasp-audit -a claude-code. Скилл появится в ~/.claude/skills/owasp-audit/SKILL.md.

Что делает owasp-audit?

Проводит аудит исходного кода по категориям OWASP Top 10:2025. Строит карту поверхностей и границ доверия, ищет кандидатов на уязвимости, проверяет каждый из них отдельным верификатором и пишет отчёт в findings.json.

Чем режим Diff/PR-scoped отличается от полного аудита?

Проверяется только изменение: ветка, PR или диапазон коммитов. Тот же полный процесс, но ограниченный дельтой, с использованием references/diff-review.md.

Исходный текст

SKILL.md · MIT
---
name: owasp-audit
description: "Audit application source code against the OWASP Top 10:2025 categories — broken access control (incl. SSRF), security misconfiguration, software supply chain failures, cryptographic failures, injection, insecure design, authentication failures, software and data integrity, logging and alerting failures, mishandling of exceptional conditions — with recon, a coverage ledger, per-finding verification, and a findings.json report. Use when the user mentions 'OWASP,' 'OWASP Top 10,' 'security audit,' 'security review,' 'secure code review,' 'code security review,' 'vulnerability audit,' 'find vulnerabilities,' 'appsec review,' 'application security audit,' 'check for security issues,' 'review this PR for security,' 'pre-merge security check,' 'diff review,' 'broken access control,' 'IDOR,' 'SQL injection,' 'XSS,' 'SSRF,' 'webhook security,' or wants to check their codebase for common security weaknesses."
allowed-tools: Read, Grep, Glob, Bash(npm audit), Bash(npm audit --omit=dev)
---

# OWASP Audit — Source Code Security Review

Perform a systematic security audit of application source code against the OWASP Top 10:2025. Every candidate is
traced, then independently challenged, before it becomes a finding. Coverage is recorded per surface and trust
boundary, so "clean" means someone actually read the code.

Cross-references:
- `api-audit` for a surface-driven pass over every API endpoint (shares the recon, verification, and orchestration references)
- `web-pentest` "Combined white-box + black-box mode" when you have both the source and a running instance you're authorized to test
- `business-logic-testing` to prove race conditions and logic flaws dynamically (A06)
- `dependency-audit` for the full A03 supply-chain picture; `secrets-audit` for leaked credentials
- `threat-modeling` for the principal / trust-boundary vocabulary used in recon
- `finding-triage` to take a single finding from this report to a defensible disposition

## Authorization and Mode

Only audit code the user owns or is authorized to review. Any live check (for example `curl -I` against a deployed
origin) needs the same authorization for that host and stays non-destructive.

Pick the mode before starting:

- **Guidance** (default): a question, a single file, or "how do I secure X". Answer directly. Findings still follow the
  verdict rules below. No ledger required.
- **Full audit**: the user explicitly asks to audit or security-review a codebase, a release, or a PR. Run the full
  workflow below.
- **Diff / PR-scoped**: the user wants a branch, PR, or commit range reviewed, or a pre-merge gate. Run the full workflow
  limited to the change, using [references/diff-review.md](references/diff-review.md).

If it's ambiguous, ask one question: guidance pass or full audit (and which profile)?

## Workflow (full audit)

1. **Scope**: what's in, what's out, mode, and run profile
2. **Recon**: write `architecture.md` and `coverage.json` before hunting
3. **Hunt**: work the category checklist unit by unit (subagents for large codebases)
4. **Verify every finding**: an independent refutation pass gives each candidate one verdict
5. **Coverage critic**: look for unmapped surfaces and thin coverage
6. **Write and validate `findings.json`**
7. **Render the report** from the JSON

Write everything to `security-audit/` at the repo root (ask whether to commit or gitignore it). Re-runs read the prior
files from there.

### Step 1 — Scope

- Language, framework, runtimes, deploy target
- In scope / out of scope, with a reason for each exclusion
- Mode (full or diff) and **run profile**: `quick`, `standard` (default), or `deep`. Profiles change breadth and
  redundancy, never the evidence bar. See [references/orchestration.md](references/orchestration.md).
- Prior run? Load the previous `findings.json` and `coverage.json` and carry forward by fingerprint (orchestration.md
  "Re-runs and carry-forward"). Never re-raise a rejected claim whose control is unchanged.

### Step 2 — Recon (read-only)

Before grepping for vulnerabilities, map the system ([references/recon-and-coverage.md](references/recon-and-coverage.md)):

- Every lower-trust principal (anonymous, user, other tenant, webhook sender, job runner) and the `file:line` where its
  controls live
- Entry surfaces: routes, server actions, loaders, tRPC procedures, GraphQL resolvers, webhooks, jobs, cron, uploads
- Sinks: DB writes/raw queries, exec, filesystem, outbound HTTP, HTML rendering, email, paid third-party calls, redirects
- What's deployed vs what's in the repo (proxy, CDN, IdP, env). These become `needs_validation` blockers later
- **Frameworks and BaaS.** Match `package.json` dependencies and config files against the detection table in
  [references/frameworks/README.md](references/frameworks/README.md) (for example `next` + `next.config.*` → Next.js,
  `@supabase/*` or `supabase/config.toml` → Supabase). Load only the matching playbooks, add their surfaces to the
  ledger, and work their checks in Step 3. Their findings use the same categories, verdicts, and format as the rest

Write `architecture.md` (≤ ~1,000 words) and seed `coverage.json` with one `planned` unit per surface × boundary ×
OWASP category.

### Step 3 — Hunt

Work through the [Audit Checklist](#audit-checklist) **per ledger unit**, not per category in the abstract. For each
unit, read the entrypoint, follow data to every sink, and record what you checked even when nothing is wrong.

- Large codebase: split units across isolated hunter subagents, unauthenticated surfaces first. Only the coordinator
  writes `coverage.json` / `findings.json`. Hunter prompt, result shape, and the sequential fallback are in
  [references/orchestration.md](references/orchestration.md).
- Source **and** a running app available (and authorized): use `web-pentest` "Combined white-box + black-box mode" so
  code findings guide live tests and live anomalies prioritize code review.
- A candidate needs a lower-trust principal, the input they control, the control that should stop them, the boundary
  crossed, the affected resource, and a concrete result. Missing any of these, it's a hardening note or needs
  validation, not a finding.

### Step 4 — Verify every finding

Before anything reaches the report, run the per-finding refutation pass in
[references/verification.md](references/verification.md). One fresh verifier per candidate (a subagent where
supported; otherwise a separate step that doesn't re-read the hunting notes). It re-reads every cited `file:line`,
names the strongest control on the path, and returns exactly one verdict. Apply the fixed exclusion rules (test,
generated, vendored, docs) first. In Claude Code, dispatch the plugin's read-only `finding-verifier` subagent per candidate.

| Verdict | Bar | Severity |
|---|---|---|
| `confirmed` | Complete entrypoint → control → sink → impact trace, or a PoC | Yes, per [references/severity-calibration.md](references/severity-calibration.md) |
| `needs_validation` | Code supports it; one decisive fact lives outside the code. Requires `blockers[]` + an owner-run `validation_plan` | No |
| `rejected` | A named control at a named location runs on every reachable path and fails closed | No; kept so re-runs don't re-raise it |

Rules that matter most:
- "Potential" is retired. Use **Needs validation**, and only with a concrete blocker and plan. It's not a parking place
  for a hunch.
- Library trust, a control on a different path, a control at the wrong time, a fail-open control, a safe sibling,
  missing information, difficulty, "operator-configurable", and "internal" do **not** rule a candidate out.
- Record `counterevidence` on every verdict. A static-only trace caps `confidence` at medium.
- An upgrade (higher verdict or severity) needs a **new** verifier.
- Gaps with no traced impact close as **hardening notes** (not findings, no severity).

### Step 5 — Coverage critic

Before writing the report, run the critic in [references/recon-and-coverage.md](references/recon-and-coverage.md)
over `architecture.md` + `coverage.json`: unmapped entry points, unchecked sibling paths, `covered` units with thin
checks, unjustified exclusions, candidates without verdicts. Add missing units and review them (or mark them
`deferred` with a reason). `covered` requires non-empty `reviewed_paths` and at least one check.

### Step 6 — Write and validate `findings.json`

Write every verdict record to `security-audit/findings.json` (sorted by fingerprint; format in
[references/findings-format.md](references/findings-format.md)), then validate both files:

```bash
# <skill-dir> = this skill's folder, e.g. .claude/skills/owasp-audit
node <skill-dir>/references/validate-findings.mjs security-audit/findings.json
node <skill-dir>/references/validate-coverage.mjs security-audit/coverage.json
```

Fix every validation error before writing prose. Fingerprints name the root cause and never include line numbers,
severity, or verdict. Optional SARIF export for GitHub code scanning: `references/to-sarif.mjs` (see findings-format.md).

### Step 7 — Render the report

Render `report.md` from `findings.json`, `coverage.json`, and `hardening-notes.md` using the [Output Format](#output-format).
The JSON is the source of truth: prose never changes a verdict, severity, blocker, or demonstrated impact. If they
disagree, fix the JSON, re-validate, and re-render.

## Audit Checklist

For each unit, grep for the patterns below, then read the flagged files and trace them.

Categories follow the **OWASP Top 10:2025**. Tag findings and coverage units `A01:2025` … `A10:2025`. Mapping for reports that
used the 2021 list: A01 → A01 (SSRF, 2021's A10, is now part of A01); Cryptographic Failures A02 → A04; Injection A03 → A05;
Insecure Design A04 → A06; Security Misconfiguration A05 → A02; Vulnerable Components A06 → A03 Software Supply Chain
Failures (broader); A07 and A08 keep their numbers; A09 is now Logging and *Alerting* Failures; A10 Mishandling of
Exceptional Conditions is new.

### A01: Broken Access Control
- Missing authorization checks on endpoints or routes
- IDOR — user-controlled IDs without ownership verification
- **Auth-check ordering.** Verify the authorization check runs *before* any branch that can reveal whether the resource exists, what state it's in, or any other resource-specific metadata. Returning 404 for "not found", 400 for "wrong state", and 401 for "not authenticated" is itself a leak — an attacker enumerates resource IDs and learns states without ever passing the auth gate. Recommended response shape: uniform 404 for everything an unprivileged caller should not see.
- **Framework RPC surfaces that don't appear as routes.** Server actions and equivalents are publicly-exposed RPCs that file scans miss. Enumerate and audit each one for auth + ownership:
  - Next.js: every exported function in a file with `'use server'`
  - Remix / React Router: every `action` / `loader` export
  - tRPC: every procedure
  - GraphQL: every resolver
  - Rails: non-resource controller actions
- **IDOR via foreign keys in mutation payloads.** Form posts a foreign-key UUID (`categoryId`, `projectId`, `teamId`, `organizationId`) → server validates ownership of the primary record but blindly accepts the FK → ORM relation join later surfaces another tenant's data. Look for `formData.get("<id>")` / `body.<id>` passed straight to insert/update without a preceding `findFirst({ where: { id, userId } })`. For ORM relation joins (Drizzle `with:`, Prisma `include`, ActiveRecord `includes`), trace whether the join target is filtered by the same tenant/ownership predicate as the parent query.
- **Inbound webhooks authenticate the caller before DB or paid work.** Email, SMS, payment, and git webhooks that identify the account from the payload (`to` address, slug) but never verify the provider's signature over the **raw** body let anyone trigger paid work and create records in another account. Provider signature table and raw-body capture: [references/webhooks-and-parsers.md](references/webhooks-and-parsers.md#2-inbound-webhook-triggers-paid-work-without-authenticating-the-caller-a01--a07). Grep: `inbound`, `parse`, `sendgrid`, `mailgun`, `postmark`, `/api/.*email`, `multer(`, `bodyParser: false`.
- Missing CSRF protections on state-changing requests
- Role checks only on the frontend, not enforced server-side
- Open redirect via post-auth return-to parameter — `?from=`, `?next=`, `?returnTo=`, `?continue=`, `?redirect=` passed unsanitized to `redirect()` / `Response.redirect()`. Restrict to same-origin paths under the expected scope, normalize (`new URL(target, "http://localhost").pathname`) to defeat traversal like `/admin/../foo`. Also reject control bytes in the path before redirect: tab/newline/null (`\t`, `\n`, `\0`) — URL parsers strip these and collapse `/\tevil` into protocol-relative `//evil`; null bytes can turn the redirect into a 500. Reject any byte in `[\x00-\x1F\x7F]`, any backslash, and any percent-encoded slash/backslash (`%2f`, `%5c`).
- Grep for: direct object references, missing auth middleware, user ID from request params, `redirect(.*from`, `redirect(.*next`, `redirect(.*returnTo`

#### SSRF (A10 in 2021; part of A01 since 2025)
- User-controlled URLs passed to server-side HTTP requests
- Missing URL validation and allowlisting
- Allow-lists that only check hostname. A real allow-list rejects wrong schemes, embedded credentials, `@`-host tricks, non-default ports, punycode/IDN spoofs, trailing dots, subdomain confusion, IPv6 literals, decimal/hex/octal IPv4, IPv4-mapped IPv6, cloud metadata endpoints, CGNAT, and link-local/unique-local IPv6. Full test set: [references/checklist-details.md](references/checklist-details.md#a01-ssrf-allow-list-bypass-set).
- Fetch-time guards: `redirect: "error"` (don't follow attacker-controlled redirects), explicit timeout, no following 3xx into the metadata service
- Note the TOCTOU between validation and fetch — DNS can resolve differently between the two (DNS rebinding). For high-risk callers, pin the resolved IP and connect by IP with `Host:` header, or use a vetted proxy
- **Image-optimizer-as-proxy** (Next.js, Nuxt, SvelteKit): `next.config.{ts,js}` with `images.remotePatterns: [{ hostname: '**' }]`, `domains: ['*']`, or any wildcard entry lets attackers route arbitrary URLs through your CPU/bandwidth.
  - Grep for: `remotePatterns`, `domains:` in image config
  - Fix: pin to specific known hostnames; leave empty if all images are local.
- Grep for: `fetch(`, `axios(`, `http.get(`, `urllib`, `requests.get(` with user input

### A02: Security Misconfiguration
- Debug mode enabled in production configs
- Overly permissive CORS policies (`Access-Control-Allow-Origin: *`). A finding only when credentials are allowed or a sensitive, non-public response is readable cross-origin; otherwise a hardening note.
- **Missing HTTP security headers** (CSP, HSTS, X-Frame-Options, X-Content-Type-Options) are **hardening notes**, not findings, unless you trace an impact (e.g. missing `frame-ancestors` on a page with a one-click sensitive action → clickjacking; missing CSP where a confirmed XSS sink exists). Baseline values and where headers live per framework: [references/checklist-details.md](references/checklist-details.md#a02-security-header-baseline-for-fixes-and-hardening-notes).
- **Deployed headers are a `needs_validation` item.** Config shows intent; proxies, CDNs, and platform defaults change what's actually sent. Unless you ran it against an origin you're authorized to probe, record a blocker ("headers actually served at `/embed`") and an owner-run check: `curl -sI https://<origin>/<path> | grep -iE 'content-security-policy|x-frame-options|strict-transport'`, with the expected output for confirmed vs rejected.
- Default credentials or configurations shipped
- Verbose error messages exposing stack traces or internals — including validation libraries echoing schema details (e.g. Zod `err.issues`, Joi error trees) to clients
- **Runtime-API mismatch.** Code running in Edge / Workers / V8-isolate runtimes can't load Node-only modules. Imports of `node:crypto`, `node:fs`, `node:buffer`, `node:net`, etc. inside Next.js `middleware.ts` / Cloudflare Workers / Vercel Edge functions compile cleanly and fail at first request with `Failed to load external module`. Audit middleware and edge-marked routes for Node-only imports; prefer Web Crypto (`crypto.subtle`) for portable code
- **Rails admin-engine mounts.** Grep `config/routes.rb` for engine and dashboard mounts (PgHero, Sidekiq::Web, Flipper UI, Mission Control, Audit1984) and verify the auth middleware in the corresponding initializer applies in *every* environment reachable from the internet — not just production. The upstream README examples wrap auth in `if Rails.env.production?`, leaving staging, review apps, and preview deploys anonymous. Fix: `unless Rails.env.local?` plus a fail-closed check when auth env vars are unset. Grep commands: [references/checklist-details.md](references/checklist-details.md#a02-rails-admin-engine-mounts).
- **Concurrent-execution races on paid endpoints.** When an endpoint triggers paid downstream work (LLM calls, third-party APIs, scrape jobs), look for `SELECT` followed by a `runX()` call without an intervening atomic claim, and unconditional `UPDATE … SET status='processing'` writes. Two concurrent requests can both pass the read-side check and both run. Fix: conditional `UPDATE … WHERE id = ? AND status = 'pending' RETURNING …`, or a Postgres advisory lock. Charge rate-limit budget only on a successful claim so polling and retries don't burn quota. (Listed under A02 because the failure manifests as a misconfigured invariant guard; the race spans A02 / A06 / A08. Prove it dynamically with `business-logic-testing`.)
- **Source-tree hygiene.** Grep for sync-conflict duplicates and dead code that could let a reviewer fix the canonical file while leaving a vulnerable copy in place:

  ```bash
  find . \( -name '* 2.*' -o -name '* 3.*' -o -name '*.orig' \
       -o -name '*~' -o -name '*.bak' \) -not -path '*/node_modules/*'
  ```

  Treat findings as A02 — the canonical file may be patched while the duplicate retains the vulnerability.
- **Next.js `headers()` rule merging.** Rules in `next.config.ts` `headers()` match per route and *merge* — a more-specific rule does not override headers it doesn't redeclare. Shipping `frame-ancestors 'none'` + `X-Frame-Options: DENY` in a `/:path*` default plus `frame-ancestors *` in a `/embed` override results in both `frame-ancestors *` and `X-Frame-Options: DENY` on the embed route (contradicting; older browsers may break framing). Config inspection alone misses the merge, so this is `needs_validation` until someone runs `curl -sI https://<origin>/embed` against the deployed origin. Fix: set XFO in every rule or drop it entirely (CSP `frame-ancestors` supersedes on modern browsers).
- **Auth middleware that doesn't exempt bearer/HMAC routes.** Cron jobs, Stripe / GitHub webhooks, and any route that authenticates via bearer token or HMAC need to be excluded from session-cookie middleware. Symptom: those routes silently 302 to `/login` on every deploy or scheduled invocation, the route-level signature check never runs, and the integration appears to "work" until it doesn't.
- **Bearer-token compare with unset env interpolation.** Comparisons that interpolate `process.env.X` without a presence check — `\`Bearer ${process.env.WEBHOOK_TOKEN}\`` — resolve to a literal `"Bearer undefined"` when the env var is missing. An attacker who guesses the env-not-set condition can replay that literal string. Assert presence at module load: `if (!process.env.WEBHOOK_TOKEN) throw new Error(...)`.
- **API routes returning HTML 302 redirects instead of JSON 401.** Auth middleware that 302s every unauthenticated request to `/login` breaks `fetch` clients (they follow the redirect and consume HTML), obscures auth state in monitoring, and lets attackers learn endpoint existence by 302 vs 404. API routes should return `401 application/json` with a machine-readable body.

### A03: Software Supply Chain Failures
- Supply chain covers more than known-CVE versions: the build, the registry, and everything that runs at install or CI time.
- Run `npm audit` (Node), `pip audit` (Python), or equivalent. These query the registry, so they need network. In a no-network run, read the lockfile for versions you know are vulnerable, record each one as `needs_validation` with "advisory data not checked" as the blocker and the audit command as the plan, and mark the A03 advisory unit `deferred` (the run is then partial). Don't call A03 clean from the lockfile alone.
- Check lock files for known vulnerable dependency versions
- Flag dependencies with critical CVEs
- Run `npm audit --omit=dev` alongside `npm audit` and triage by reachability:
  - Runtime-reachable (in `dependencies`) — must fix
  - Build-time-only (Vite, esbuild via drizzle-kit, postcss) — usually defer
  - Dev-only (linters, test libs) — defer
- For the full CVE picture and triage by reachability, invoke `dependency-audit`. Known-CVE versions are a one-line sanity check here.
- Missing integrity checks on CI/CD pipelines
- No lockfile integrity verification (SRI hashes)
- Third-party scripts and styles loaded from a CDN without Subresource Integrity (`<script src=… integrity="sha384-…" crossorigin>`), or from a host that serves different content per request.
- Install-time code (`postinstall`, `prepare`, `setup.py`, build plugins) and dependency confusion / typosquats: hand off to `dependency-audit`.
- Grep for: `<script src="https://`, `integrity=`, `"postinstall"`, `uses: .*@(main|master|v\d+)$` in `.github/workflows/`

### A04: Cryptographic Failures
- Hardcoded secrets, API keys, or passwords in source. Confirm the key type (publishable vs restricted vs secret) and the authority it grants before rating it: a public identifier called a "key" is not a secret.
- Weak hashing (MD5, SHA1 for passwords instead of bcrypt/argon2/scrypt)
- For bcrypt, also check the cost factor. OWASP 2024 guidance is ≥ 12 (cost 10 ≈ 10ms / 100 hashes/sec/core for an attacker)
- **Type coercion in cryptographic-verification paths.** Numeric parsing (`parseInt`, `Number`, `parseFloat`) silently produces `NaN` for garbage input, and `NaN` compares as `false` for both `<` and `>`. A timestamp-freshness check `if (Math.abs(now - parsed) > tolerance) return false` *fails to reject* `NaN` — because `NaN > tolerance` is `false`. Grep for: `parseInt|parseFloat|Number\(.*\)` inside `verifySignature` / `validateToken` / signed-cookie / JWT-claim code. Each numeric extraction must be followed by `if (!Number.isFinite(parsed)) return false` before any inequality. Same family: `parseInt('0x123', 10) === 0`, `parseInt('1e10', 10) === 1`, `parseFloat('Infinity') === Infinity`.
- Sensitive data in logs, URLs, or localStorage
- Missing encryption at rest or in transit
- **Before recommending `VERIFY_PEER` for a TLS connection,** identify the cert issuer at the deployment target. Many managed services ship self-signed cert chains at lower tiers (Heroku Redis Mini/Hobby, some ElastiCache configurations, Supabase legacy) — `VERIFY_PEER` fails there without an explicit `ca_file:` pin. When `VERIFY_PEER` is genuinely infeasible, present three remediation options in priority order:
  1. Upgrade the plan or pin the CA bundle — restores cert verification
  2. Accept the risk explicitly — leave `VERIFY_NONE` with (a) an in-line comment at every call site, (b) a documented compensating control (private network, internal-only routing), (c) a follow-up issue tracking re-verification conditions
  3. Restrict the network path — private subnet / VPC peering / no public exposure

  Never quietly recommend `VERIFY_PEER` without checking that the cert chain at the deployment target is verifiable.
- Grep for generic secret names AND known provider key prefixes:
  - Generic: `password`, `secret`, `api_key`, `private_key`, `MD5`, `SHA1`, `base64`
  - Stripe: `sk_live_`, `sk_test_`, `rk_live_`, `whsec_`
  - GitHub: `ghp_`, `gho_`, `ghu_`, `ghs_`, `ghr_`
  - AWS: `AKIA[0-9A-Z]{16}`, `ASIA[0-9A-Z]{16}`
  - Google Cloud: `AIza[0-9A-Za-z\-_]{35}`, service-account JSON (`"type": "service_account"`)
  - Slack: `xox[baprs]-`, `xoxe.xoxp-`
  - OpenAI / Anthropic: `sk-`, `sk-ant-`
  - Vercel: `vercel_blob_rw_`
  - Run via `git ls-files | xargs grep -lE 'sk_live|ghp_|AKIA[0-9A-Z]{16}|sk-ant-' 2>/dev/null` so binaries and gitignored files don't pollute output.
- **Include non-source file extensions in the sweep.** Rails `cable.yml` / `database.yml` / `storage.yml`, Kubernetes manifests, and Vercel / Netlify deploy configs routinely contain TLS or cert config that a source-only sweep misses:

  ```bash
  grep -rn "VERIFY_NONE\|verify_mode" --include="*.rb" --include="*.yml" --include="*.yaml" \
    --include="*.toml" --include="*.json" .
  ```

### A05: Injection
- **SQL injection:** raw queries with string concatenation, missing parameterized queries
- **NoSQL injection:** unsanitized user input in MongoDB/Convex queries
- **Command injection:** `exec()`, `spawn()`, `system()` with user input
- **XSS:** unescaped user input in HTML, `dangerouslySetInnerHTML`, `v-html`.
- **Inline-script breakout via `JSON.stringify`.** Any `<script type="application/ld+json">` or `<script>window.__DATA__ = ...</script>` that interpolates server data through `JSON.stringify` is vulnerable — `JSON.stringify` does NOT escape `<`, `>`, `&`, U+2028, or U+2029. A stored title containing `</script><script>alert(1)</script>` will break out. The "internal-only object" framing only saves you when every field is guaranteed never to come from user-editable input.
  - Grep for: `application/ld+json`, `__html: JSON.stringify`, `window.__` + `JSON.stringify`
  - Fix: wrap with an escape helper that replaces `<>&

` with their `\uXXXX` Unicode escapes before injecting.
- **Rails ERB sinks:** `raw()`, `.html_safe`, `<%==`, `sanitize` with a permissive allowlist, and `simple_format` on user input. Grep for these alongside `dangerouslySetInnerHTML` / `v-html`.
- **Sanitizer choice.** When remediating an HTML/SVG XSS sink, the fix MUST use a vetted parser-based sanitizer (DOMPurify / isomorphic-dompurify / sanitize-html for JS; bleach for Python). Reject regex-based sanitizers in code review. If unavoidable, a regex sanitizer must:
  - Treat `[/\s]` (not just `\s`) as the attribute-name separator — HTML accepts `/` between tag name and first attribute: `<img/onerror=…>`
  - Strip both SVG- and HTML-namespace dangerous elements (`<img>`, `<body>`, `<video>`, `<iframe>`) — HTML elements instantiate even in SVG-rendering contexts
  - Include a final fallback pass that strips any `on*=` regardless of surrounding context
  - Be paired with `Content-Security-Policy: script-src-attr 'none'` as a browser-level backstop
- **SVG uploads as stored XSS.** SVG files can carry `<script>` / `onload`. Most blob / object storage serves uploads with the declared content-type. Reject `image/svg+xml` in upload allow-lists unless you have a sanitizer (e.g. DOMPurify SVG profile) and serve with `Content-Disposition: attachment`.
- **Sanitize on write AND on render.** For stored XSS / injection, sanitize at the trust boundary (write to DB) AND at the render boundary (defense in depth). On finding a stored-XSS bug, plan a one-time backfill migration to sanitize existing data — render-only fixes leave poisoned rows that any new render path will re-expose.
- **Rails JSON-LD breakout:** inside `<script type="application/ld+json">`, do NOT use `j` / `escape_javascript` for field values — it emits `\'` and `\$` (valid JS, invalid JSON). Use `json_escape(schema.to_json).html_safe`; full idiom and round-trip check in [references/checklist-details.md](references/checklist-details.md#a05-rails-json-ld-idiom).
- **Template injection:** user input in template literals
- Grep for: `exec(`, `eval(`, `innerHTML`, `dangerouslySetInnerHTML`, `$where`, raw SQL strings

### A06: Insecure Design
- Authentication flows with logic flaws
- Missing rate limiting on sensitive endpoints (login, password reset, API)
- Business logic constraints only enforced client-side
- **Request parsers have explicit limits (multipart, urlencoded, JSON depth/size).** A 78-byte multipart request with `x[1000000]=1` parsed into a million-element array (~5 MB of JSON) that the handler stored before validating it. Proxy size caps don't stop amplification. Check `multer`/busboy/formidable `limits`, `.none()` for unused files, `qs`/`body-parser` `parameterLimit`/`depth`, Rack param limits; validate an allowlisted payload before logging or storing. Per-framework table: [references/webhooks-and-parsers.md](references/webhooks-and-parsers.md#1-request-parsers-without-explicit-limits-a06--a02).
- **Background / fire-and-forget jobs** inherit the caller's auth context but lose the request-scoped guards. Re-check authorization inside the job, not just at enqueue. Grep for: `Promise.all(...).catch(`, `void someAsync(`, `.catch(noop)`, queue `enqueue(` without re-auth in the worker.
- **Sister-route audit.** When you find a state-machine or immutability guard on one handler (e.g., `WHERE … AND signedAt IS NULL` on `PUT /api/foo/[id]`), grep for every other handler that writes the same table:

  ```bash
  rg 'update\(\s*tableName\b|\.update\(tableName' --type ts -B1 -A8
  ```

  Each call site needs the same guard, the same `userId` predicate, and the same conflict-handling (`returning()` + 0-rows check). Common offender: a `POST /:id/send` or `POST /:id/convert` route that ships after the `PUT` was hardened and was never re-audited.
- **External-resource-create TOCTOU with billing implications.** Any handler that does "SELECT to check, then `provider.create()`, then INSERT to record the new resource ID" can create orphan resources...

© briiirussell · MIT · briiirussell/cybersecurity-skills

Похожие скиллы

Все скиллы по теме «Безопасность» →
owasp-top10-analysis securityskills Скилл owasp-top10-analysis для Claude Code пошагово проверяет веб-приложение по десяти категориям OWASP Top 10 2021 года и помогает провести аудит безопасности с отчётом о найденных рисках. CX Codex +1 813установок owasp-top10-expert 0xfurai Субагент owasp-top10-expert для Claude, который проходит код и конфигурацию по десяти категориям OWASP Top 10 и выдаёт отчёт с рисками и способами их закрыть. CX Codex ★ 1 029звёзд репо owasp-security-check sergiodxa Скилл owasp-security-check для аудита веб-приложений и REST API: 20 правил по OWASP Top 10, разбор auth, инъекций и утечек данных. Пригодится перед выкатом в прод. CX Codex +1 1 800установок owasp-security agamm Скилл owasp-security для проверки кода и диффов на уязвимости по OWASP Top 10:2025, ASVS 5.0 и спискам рисков для LLM и агентов. Пригодится при ревью перед релизом. CX Codex +1 2 800установок Python Security Vulnerability Auditor (OWASP-Mapped & Production-Hardened) sivasaiyadav8143 Промпт Python Security Vulnerability Auditor (OWASP-Mapped & Production-Hardened) проверяет Python-код, сопоставляет уязвимости с OWASP Top 10 и выдаёт исправленную версию. GP ChatGPT ★ 178 201звёзд репо owasp-llm-top10 mastepanoski Скилл owasp-llm-top10 проводит аудит безопасности LLM- и GenAI-приложений по OWASP Top 10 for LLM Applications 2025. Пригодится перед выкаткой чат-бота или RAG-системы. CX Codex +1 415установок

Из того же набора29

Весь набор →
web-pentest Скилл web-pentest для Claude Code ведёт чёрный и серый пентест живого веб-приложения по фазам OWASP WSTG. Перед стартом требует подтверждения письменного разрешения и скоупа. CX Codex +1 722установок api-audit Скилл api-audit для Claude Code проверяет REST, GraphQL и RPC API по OWASP API Security Top 10 (2023). Ищет проблемы авторизации, аутентификации и раскрытия данных. CX Codex +1 646установок dependency-audit Скилл dependency-audit проверяет зависимости, фреймворки и инструменты разработки на известные уязвимости и риски цепочки поставок. Пригодится перед релизом или разбором CVE. CX Codex +1 606установок secrets-audit Скилл secrets-audit находит утечки токенов и паролей в коде, истории Git и сборках, а также проверяет правила хранения секретов. CX Codex +1 594установок recon Скилл recon для Claude Code, Codex, Cursor, Copilot, Gemini CLI и OpenCode, который проводит структурированную разведку цели и строит карту поверхности атаки. Запускается на авторизованных пентестах, CTF и bug bounty программах. CX Codex +1 534установок threat-modeling Скилл threat-modeling разбирает новую фичу или архитектуру по STRIDE до написания кода: DFD с границами доверия, abuse cases и решение по каждой угрозе. CX Codex +1 532установок mobile-audit Скилл mobile-audit проверяет мобильные приложения для iOS и Android по стандартам OWASP MASVS и MASTG. Находит уязвимости в хранилищах данных, криптографии, диплинках и сетевых настройках. CX Codex +1 490установок osint-recon Скилл osint-recon собирает и сопоставляет общедоступную информацию для анализа периметра и исследования угроз. Пригодится при аудите защищённости инфраструктуры. CX Codex +1 486установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой