agentleFS
leaf76leaf76/agent-skills/security-audit/SKILL.md

security-audit

Skill0 starsChanged 3 months agoMITView on GitHub

Audit code for security vulnerabilities using repository-grounded review, attacker thinking, and targeted verification steps. Use before deploying to production, during security reviews, when reviewing PRs with security implications, or after discovering potential vulnerabilities.

140 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use asset-spec, create-control-manifest 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.
  • cenconq25Skill

    asset-spec

    Generates per-asset visual specifications and AI-generation prompts from PRDs and the design bible. Produces structured spec files and updates a master asset manifest. Use after design bible is approved and a UX spec or PRD identifies assets to produce. Output: design/assets/<asset>.md plus design/assets/manifest.md.

    Also in 5 projects that use this

  • cenconq25Skill

    create-control-manifest

    Produces a flat, immediately-actionable rules sheet — do this, never do that, per system and per layer — extracted from accepted ADRs, technical preferences, and framework reference docs. More directly usable than ADRs for day-to-day implementation. Run after /architecture-review passes.

    Also in 5 projects that use this

  • +10 more from cenconq25

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 118 edited versions we read keep these.

  • 16

    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:

    If specific files are provided, focus on those.

    line 27
  2. Distinctive:

    Before writing findings, understand:

    line 29
  3. Distinctive:

    Use focused scans when helpful:

    line 50
  4. Distinctive:

    Verify all SQL uses parameterized queries

    line 67
  5. Distinctive:

    Verify dynamic identifiers are validated against allowlists

    line 69
  6. Distinctive:

    Check mass assignment and over-posting risks

    line 89
  7. Distinctive:

    Verify SSRF, redirect, and file-path inputs are constrained

    line 90
  8. Distinctive:

    Never log passwords, tokens, API keys, or PII

    line 94
  9. Distinctive:

    Verify trace IDs appear where required

    line 95
  10. Distinctive:

    Check that error messages returned to clients do not leak internals

    line 96
  11. Distinctive:

    Verify controls at every boundary

    line 118
  12. Distinctive:

    Check failure modes and rollback behavior

    line 119
  13. Distinctive:

    Call out security controls that are implemented correctly when relevant.

    line 143
  14. Distinctive:

    Prefer fewer, higher-confidence findings over broad generic warnings.

    line 151
  15. Distinctive:

    If the code appears secure, explain why.

    line 152
  16. Distinctive:

    When a fix affects auth, permissions, payments, or data mutation, recommend tests for the critical paths.

    line 153

“Common” is measured: kept by at least 6 in 10 of the 118 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 Audit

You are an Application Security Engineer. Audit the target code from first principles and ground every conclusion in actual code paths.

Execution Checklist (MUST follow in order)

  • Step 1: Identify scope (git status --short or user-provided files)
  • Step 1: Read target files and trace the relevant data flow
  • Step 2: Check trust boundaries, authz/authn, input validation, data handling, and dependency risk
  • Step 2: Run targeted scans for secrets and risky constructs when relevant
  • Step 3: Produce a structured report with severity, exploit path, and remediation

Step 1: Identify Scope

Start with:

Recent changes: !`git status --short`

If specific files are provided, focus on those. Otherwise, audit recent changes or the files the user mentions.

Before writing findings, understand:

  • Entry points
  • Untrusted input sources
  • Authorization boundaries
  • Data stores and external dependencies
  • User-visible and operator-visible failure paths

Step 2: Security Review Workflow

Trust Boundary Review

Map:

  • Public input surfaces
  • Internal service boundaries
  • Admin-only or privileged paths
  • Data crossing between systems

Targeted Scans

Use focused scans when helpful:

# Secret and credential markers
rg -n "password|secret|token|api[_-]?key|BEGIN [A-Z ]+PRIVATE KEY|AKIA|sk_live_" [target_files]

# Query and command execution hotspots
rg -n "SELECT|INSERT|UPDATE|DELETE|query\\(|execute\\(|exec\\(|spawn\\(|system\\(" [target_files]

# Auth and permission enforcement points
rg -n "auth|authorize|permission|role|scope|csrf|cors|session|jwt" [target_files]

Required Security Checks

SQL Injection Prevention

  • Verify all SQL uses parameterized queries
  • Flag string concatenation, interpolation, or unsafe dynamic clauses
  • Verify dynamic identifiers are validated against allowlists

Red flags:

query = f"SELECT * FROM users WHERE name = '{user_input}'"
query = "SELECT * FROM " + table_name

Authentication and Authorization

  • Protected routes must require authentication
  • Sensitive actions must enforce authorization
  • Object access must prevent IDOR
  • Session, token, or cookie handling must be scoped and validated

Input Validation and Output Safety

  • Validate length, format, enum membership, and ranges
  • Escape or sanitize output where the rendering context requires it
  • Check mass assignment and over-posting risks
  • Verify SSRF, redirect, and file-path inputs are constrained

Secrets, Logging, and Traceability

  • Never log passwords, tokens, API keys, or PII
  • Verify trace IDs appear where required
  • Check that error messages returned to clients do not leak internals

Red flags:

logger.info(f"User login: {username}, password: {password}")
logger.debug(f"API key: {api_key}")

Business Logic Abuse

Think like an attacker:

  • Can limits be bypassed with concurrency?
  • Can state transitions happen out of order?
  • Can financial or permission rules be manipulated?
  • Can retries or duplicate submissions create inconsistent state?

Verification Approach

  1. Understand the feature and data flow
  2. Trace untrusted input to storage, output, or side effects
  3. Verify controls at every boundary
  4. Check failure modes and rollback behavior
  5. Evaluate exploitability, not just theoretical possibility

Output Format

Provide findings in Traditional Chinese:

Security Analysis Summary

Summarize:

  • Number of confirmed findings
  • Highest-risk issues
  • Areas reviewed and any remaining blind spots

Findings

For each issue include:

  1. Severity
  2. File and line
  3. Vulnerability description
  4. Exploit path or abuse scenario
  5. Recommended remediation

Defensive Strengths

Call out security controls that are implemented correctly when relevant.

Residual Risk / Unknowns

List only meaningful gaps in evidence or areas not fully verifiable from the available context.

Important Notes

  • Base findings on actual code evidence; do not speculate without saying so.
  • Prefer fewer, higher-confidence findings over broad generic warnings.
  • If the code appears secure, explain why.
  • When a fix affects auth, permissions, payments, or data mutation, recommend tests for the critical paths.

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.