agentleFS
kapadiaskapadias/nonna/.claude/skills/security-review/SKILL.md

security-review

Skill0 starsChanged 47 days agoMITView on GitHub

A change touching authentication, authorization, secrets, money, user data, deserialization, file/URL/network handling, or anything outward-facing. Threat-model pass beyond correctness review.

190 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use dependency-cve-sweep, fleet-standard-adoption and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • berntpoppSkill

    dependency-cve-sweep

    Use when handling Dependabot PRs, CodeQL/Trivy alerts, or doing a routine dependency/CVE sweep for this repo.

    Also in 12 projects that use this

  • berntpoppSkill

    fleet-standard-adoption

    Use when bringing this repo into compliance with a GeneFoundry fleet standard (tool-naming, response-envelope, container-hardening, versioning, MCP transport, or logging) or closing its tracking issue.

    Also in 12 projects that use this

  • xfstudioSkill

    linkerd-patterns

    Implement Linkerd service mesh patterns for lightweight, security-focused service mesh deployments. Use when setting up Linkerd, configuring traffic policies, or implementing zero-trust networking with minimal overhead.

    Also in 6 projects that use this

  • xfstudioSkill

    team-composition-analysis

    This skill should be used when the user asks to "plan team

    Also in 5 projects that use this

  • HABUBUSSSkill

    project-guidelines-example

    Also in 16 projects that use this

  • niloykumarbarmanSkill

    agent-sort

    Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

    Also in 13 projects that use this

  • +2 more from berntpopp

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 162 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every CRITICAL/HIGH finding carries a concrete abuse path: the input, the step, the consequence.

    line 15
  2. Distinctive:

    If you cannot sketch one, you have a hardening suggestion (MEDIUM at most), not a vulnerability.

    line 16

“Common” is measured: kept by at least 6 in 10 of the 162 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Security Review

Think like the attacker who wants your data, your money, or your compute — not like the author who wants the feature to ship. The correctness reviewer asks "does it work?"; you ask "how is it abused?" A finding that only says something "smells" is noise. Show the exploit or downgrade the severity. Safety is lexicographically prior to speed (.claude/rules/safety.md).

The exploit-sketch contract — non-negotiable

Every CRITICAL/HIGH finding carries a concrete abuse path: the input, the step, the consequence. If you cannot sketch one, you have a hardening suggestion (MEDIUM at most), not a vulnerability.

api/files.py:42 — CRITICAL (path traversal): open(base + request.path) with no canonicalization. Exploit: GET /files?path=../../../../etc/passwd escapes base and reads arbitrary host files. Fix: resolve to an absolute real path and assert it is under base (realpath/os.path.commonpath); reject otherwise.

The sketch is what turns "looks risky" into a gate a deterministic check can be written against.

Threat-model checklist — trace each from untrusted source to dangerous sink

Untrusted = anything you don't fully control: request bodies, params, headers, cookies, file uploads, filenames, env on a shared host, and any LLM output. Walk each from where it enters to where it acts.

  • Injection — untrusted text reaching an interpreter: SQL, shell/exec, OS command, NoSQL, LDAP, template (SSTI), XSS into HTML, log injection. Sink test: is the value ever concatenated into a query/command/markup instead of passed as a bound parameter / via execve-style arg arrays / context-aware escaped? Parameterize; never interpolate.
  • Broken authz / IDOR — the request is authenticated but the object isn't authorized. GET /invoice/1043 returning another tenant's invoice because the handler loads by id without an owner predicate. Test every object read/write: is there a WHERE owner = current_user (or equivalent policy check) at the data layer, not just a UI gate? Check function-level authz too (can a normal user call the admin endpoint?).
  • Secret leakage — keys/tokens/PII in code, logs, traces, error responses, URLs (query strings get logged), stack traces returned to clients, or LLM prompts. Grep the diff for hardcoded credentials and for logging of whole request/response objects. (.claude/rules/engineering.md)
  • Unsafe deserialization — pickle, Java/Ruby native deserialization, YAML load (vs safe_load), eval/Function on input. These are remote code execution, not data bugs. Untrusted bytes must hit only a schema-validated, type-restricted parser.
  • SSRF — server fetches a user-supplied URL (webhooks, image proxies, "import from URL", PDF renderers). Exploit: http://169.254.169.254/latest/meta-data/ steals cloud credentials; internal hostnames reach private services. Deny by default: allowlist schemes/hosts, resolve then re-check the IP (block link-local/private/loopback), and disable redirects to new hosts.
  • Supply chain — a new/changed dependency, a postinstall script, a lockfile delta. Hand to the supply-chain skill; do not eyeball-approve transitive trees.

Also sweep: auth/session (token validation, expiry, fixation, weak/missing CSRF on cookie auth), crypto (no homemade crypto, no ECB, no static IV, constant-time compares for secrets/HMACs), SSRF's cousins (open redirect, XXE via external entities), mass assignment (binding request JSON straight onto a model exposes is_admin), and rate-limiting on auth/expensive endpoints.

Severity rubric — inherits code-review, with a security lens

Same scale as the code-review skill so verdicts compose. Anchor on blast radius × reachability.

SeveritySecurity meaning
CRITICALRemote exploit reaching prod data/money/RCE with a plausible path: injection, authz bypass/IDOR, deserialization RCE, SSRF to metadata, leaked live credential. Auto-block.
HIGHReal vuln gated by a precondition (needs a low-priv account, a specific config) — stored XSS, missing object authz on a sensitive write, secret in logs, CSRF on a state change. Block merge.
MEDIUMDefense-in-depth gap with no direct exploit shown — missing rate limit, weak header, overbroad token scope, verbose error. Fix when feasible.
LOWHardening nicety — header polish, dependency a major behind with no known CVE. Optional.

Auto-CRITICAL with no debate: a working injection, an authz bypass, a leaked live secret, or untrusted bytes into a code-executing deserializer. The verdict cannot be safe-to-merge until each is closed or has a deterministic gate (validation/policy check) proven in front of it.

Validate at the edge, fail closed

The two principles that close most of the above. Parse untrusted input into a typed, bounded structure at the boundary and reject out-of-contract — never clamp-and-proceed (.claude/rules/boundaries.md). On any ambiguity — auth check errored, allowlist lookup failed, signature unverifiable — deny, don't proceed. A missed stop can be terminal; a false stop costs a retry (.claude/rules/safety.md).

Finding & verdict format — identical contract to code-review

One finding = path:line + category + the exploit sketch + a concrete fix. Close by emitting the same structured JSON verdict as the correctness review — schema: ../code-review/templates/verdict.json. Each finding is one object (severity, path, line, category: "security", issue, fix); the top-level verdict is approve or request_changes. Pipe it through the deterministic gate:

your-review-step | .claude/skills/code-review/scripts/check-review.sh

The gate exits 1 on request_changes or any CRITICAL/HIGH — safe-to-merge once every CRITICAL and HIGH is closed. Prefer few high-confidence findings with real abuse paths over a long speculative list — ten "could be hardened" notes bury the one RCE. The deterministic gate decides, not the author's confidence. Route security-sensitive diffs through the security-reviewer agent; pair with the code-review skill for the correctness pass.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.