Generated banner for Security Audit
Generated logo for Security Audit

Security Audit

CloudflareOfficialPublished by Cloudflare

  • Skill
  • Review and audit
  • Security
  • MIT
  • Low risk
  • Has scripts

From the author

Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.
— the description by Cloudflare

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a rigorous, defensive workflow for conducting security audits and vulnerability research. It operates in two modes: a guidance mode for focused investigations and a full audit mode for comprehensive, end-to-end reviews. The framework emphasizes sandboxed, local-only execution, requiring concrete evidence of a trust boundary violation to confirm a finding. It includes strict protocols for write isolation, budget management, and independent verification to ensure audit integrity and reproducibility.

What it does

  • Performs structured security audits on codebases, APIs, and services.
  • Validates vulnerabilities using sandboxed, local-only execution environments.
  • Generates comprehensive audit reports including findings, evidence, and remediation guidance.
  • Manages audit coverage through a deterministic ledger system.
  • Enforces strict write isolation to protect target source and audit artifacts.
  • Provides methodology for triage and investigation of specific security findings.

When to use it

  • When performing a comprehensive, end-to-end security review of a codebase.
  • When conducting vulnerability research on specific libraries or daemons.
  • When seeking expert guidance on security methodology or triage.
  • When a formal, documented security audit report is required.
  • When investigating potential trust boundary violations in source code.

Advantages

  • Ensures high-integrity results through independent verification phases.
  • Minimizes risk by enforcing strict, sandboxed execution boundaries.
  • Provides clear, evidence-based findings rather than generic hardening advice.
  • Supports reproducible audits with structured metadata and coverage tracking.
  • Prevents false positives by requiring concrete, observable boundary violations.

Usage examples

“Perform a full security audit of this repository.”
The agent initiates the six-phase audit workflow, starting with reconnaissance and ledger setup, followed by hunting waves and independent validation to produce a final security report.
“I have a question about the authentication flow in this API; can you help me investigate?”
The agent enters guidance mode, focusing on the specific authentication logic without triggering the full audit workflow or creating formal report artifacts.

Install

  1. Download the skill as a ZIP:

    https://mp-staging.autogineer.com/agent-skills/cloudflare/security-audit/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip security-audit.zip -d .agents/skills

Documentation by Cloudflare

Security Audit

Find vulnerabilities that violate a real trust boundary, then give owners the source evidence, safe reproduction, priority, and smallest effective fix. This is a defensive, source-first workflow. A candidate without a concrete affected principal, resource, or security outcome is not a confirmed finding.

Operating modes

This skill is guidance by default. Loading it does not authorize the complete audit workflow or file creation.

  • Guidance mode: For security questions, focused reviews, methodology, triage, or investigation of specific findings, use only the relevant parts of this skill. Do not automatically run all six phases, create an output directory, or write audit artifacts. You may launch focused agents when useful; they return results to the current task.

  • Full audit mode: Use the complete workflow when the user explicitly asks to audit or pen-test a codebase, asks for a full, comprehensive, or end-to-end security review, or requests report artifacts. Run all six phases and write the files defined below.

If the request could mean either mode, ask one focused question before creating files or starting the complete workflow.

Platform terminology

This skill is agent-neutral:

  • Parent is the agent that coordinates the run and owns shared state.

  • Task tool is the platform's delegation or sub-agent mechanism.

  • research agent is a delegated agent for focused source exploration and factual verification.

  • general agent is a delegated agent for broad investigation and bounded local execution.

  • subagent_type: in a heading names which of these two delegated agent roles runs that work.

Use equivalent platform capabilities while preserving role, write-isolation, prompt, and independence boundaries.

Universal execution safety

These rules apply in both operating modes. Source inspection is read-only. Run target-controlled builds, tests, processes, browsers, emulators, fuzzers, and fixture processing only inside an OS-enforced sandbox that provides all of these controls:

  • no external network; use only an isolated loopback namespace when the check needs local client/server traffic;

  • an empty environment populated from an explicit allowlist with safe values, with scratch-local HOME, temporary directories, and caches;

  • a read-only target and toolchain, with the target-controlled process able to write only inside its assigned scratch/ directory; and

  • explicit low CPU, memory, process, file-size, disk, and wall-clock limits.

The agent, outside the target-controlled process, may make a disposable source copy in an assigned scratch/ directory when a build must write beside source. In guidance mode, do not retain target-controlled files. In full audit mode, only trusted parent-side code may promote the minimum non-secret result to retained artifacts/ using the procedure under Write isolation. Never expose a retained output directory (other than the agent's own assigned scratch/), another agent's directory, the host home directory, credentials, sockets, or shared services to target code. Do not install dependencies or let builds fetch them. Use only tools and dependencies already available locally. If every control cannot be enforced, do not execute target code: report the missing sandbox capability as a needs-validation blocker and give a safe validation plan.

Use dummy principals, fixtures, and secrets. Do not probe deployed endpoints, external services, shared infrastructure, production identities, other users' data, or live control planes. Do not test availability against a live or shared process, publish artifacts, alter releases, spend paid API quota, or continue beyond the minimum local effect needed to establish a defect. If the decisive fact is outside source or the sandboxed fixture, report it as needing validation.

Full audit setup

In full audit mode, resolve these values before reconnaissance:

  • Skill directory: the absolute directory containing this SKILL.md.

  • Target: the absolute repository root under review.

  • Repo name: a stable repository identifier from the directory or local Git remote.

  • Output directory: a new writable directory outside the target, defaulting to ~/security-audit-skill/<repo-name>/run-<N>, where <N> is the next unused integer. Use a directory inside the target only when the user explicitly selects it and the parent verifies that version control ignores the whole directory. Otherwise stop and request an external path.

  • Source ref: the reviewed commit and whether the worktree is dirty. Do not treat unreviewed generated or modified files as another revision.

Write isolation

The parent creates and is the only writer of shared run files:

  • run-metadata.json

  • architecture.md

  • coverage-ledger.json

  • findings.json

  • REPORT.md

  • FINDINGS-DETAIL.md

  • NEEDS-VALIDATION.md

Each hunter or verifier receives a unique root under <output-dir>/agents/<agent-id>/, with separate scratch/ and artifacts/ directories. Canonical agent IDs match ^[a-z0-9][a-z0-9_-]{0,63}$ and must not equal a Windows device name such as con, prn, aux, nul, com1 through com9, or lpt1 through lpt9. Lowercase IDs prevent case-fold collisions. The agent and every target-controlled process may write only to scratch/; retained artifacts/ is parent-owned, is never exposed to the sandbox, and is writable only by trusted parent-side promotion code. Agents may not change shared files, target source, retained artifacts, or another agent's directory. Do not use /tmp or the host home directory as a writable fallback.

Before execution, the parent opens and retains trusted, non-inheritable directory descriptors for the agent's scratch/ and artifacts/ roots, and records an allowlist of expected scratch-relative artifact files plus explicit per-file and cumulative byte limits. Never pass those descriptors to the agent or sandbox. After the sandbox and all its processes terminate, trusted parent-side code promotes each allowlisted file separately:

  1. Validate the declared relative path: reject absolute, empty, ., .., or symlinked components.

  2. Walk each parent component from the retained scratch-root descriptor with no-follow directory-relative operations; never reopen by path.

  3. Open the leaf no-follow and nonblocking.

  4. Verify with fstat that it is a regular file with link count exactly one and within the recorded per-file and cumulative byte limits.

  5. Enforce those limits again while reading from that descriptor.

  6. Copy exactly the verified size, repeat fstat, and reject a changed identity, type, link count, or size.

  7. For the destination, walk every parent component from the retained artifacts-root descriptor with no-follow directory-relative operations; require each existing component to be a real directory, and create any missing directory exclusively before reopening and verifying it no-follow.

  8. Create the leaf exclusively without following links, verify that the opened destination is a regular file with link count exactly one, and copy from the verified source descriptor without reopening either path.

  9. Use equivalent race-safe APIs on non-POSIX systems.

  10. Never recursively copy or glob scratch, extract an archive into artifacts, or open or promote a symlink, FIFO, socket, device, directory, hard-linked file, changing file, or file that exceeds its bound.

  11. If any check is unavailable, cannot be enforced, or fails, discard the scratch entry; if it is decisive evidence, retain needs_validation with the exact promotion blocker.

HUNTING.md and VALIDATION-AND-REPORTING.md carry this procedure as one identical fenced block for hunter and verifier prompts; it states the same rules in the same order as this list.

For a reproduced check, record the command, exact test input, sandbox limits, and only the allowlisted environment variable names plus safe non-secret values needed to reproduce it. Never capture or copy the ambient environment, inherited variables, credential values, authentication state, or unrelated host paths. Launch from an empty environment rather than trying to redact one after execution.

Before delegation, the parent writes run-metadata.json with at least run_id, repo, target, source_ref, profile, scope_paths, budget (null if unset), execution_policy: "sandboxed-source-and-local-only", selected companion files, prior-run paths, shared-file owners, and run_status: "in_progress". Update metadata only when those facts change; candidate state belongs in the coverage ledger and findings.json.

Full audit planning

The coverage, prior-run, profile, and budget requirements in this section apply only in full audit mode.

Coverage and prior runs

No one pass is complete. Build a deterministic coverage plan before hunting and update it after every agent result. RECONNAISSANCE.md defines the stable coverage units and HUNTING.md defines coverage-critic waves. The parent alone updates the ledger.

If prior runs exist, read every compatible coverage-ledger.json and findings.json before planning the current run:

  1. Compare the relevant current source with each prior record and unit. A prior source ref alone is not evidence that a path is unchanged.

  2. Carry a prior confirmed record into the current candidate set only when its relevant source and conditions are unchanged and its evidence still meets the current contract. Link it to a current ledger unit seeded planned, preserve its fingerprint, exclude only that carried root cause from hunters, and send the carried record through the current final verification path; the Phase 3 verifier that re-checks it becomes that unit's assignment owner and moves it to candidate.

  3. When relevant source for a prior confirmed record changed, create a current planned revalidation unit. Do not put that record on the hunter exclusion list. It remains confirmed only if current independent validation establishes the current path and result.

  4. Make prior needs_validation, deferred, blocked, out_of_scope, and any changed-source unit current work. A still-external needs_validation record may be carried only after the current source trace is checked and linked by fingerprint to a current planned unit whose verifier re-check supplies its owner and evidence; the record keeps the unresolved blocker. These prior states never suppress a current unit.

  5. A prior same-source covered unit may inform priority, but it remains visible in the current ledger. A prior rejected record suppresses only the unchanged failed claim, not coverage of its unit; changed evidence creates current work.

  6. Read the prior profile and scope. A prior quick or scoped ledger contributes only its recorded evidence and gaps, never an implied "rest is fine."

If no prior ledger exists, say so in the final coverage statement. Never imply that one run exhausts the target.

Run profiles and scope

During full audit setup, pick a profile from the user's request or propose one from the target's size and stakes. Record it in run-metadata.json (profile, scope_paths) and state it in the report. The default is standard.

  • quick — a bounded pass for small targets, re-runs, or a fast first look. Coarsen ledger units to surface × boundary × attack class (subsystem uses the fixed canonical profile/quick/all-in-scope-subsystems identifier), run exactly one hunter wave followed by exactly one final coverage-critic pass, and use one fresh verifier per candidate for both candidate validation and final record verification. Do not launch a follow-up hunter wave: record the critic's accepted discoveries and reassignments as deferred.

  • standard — the workflow as written.

  • deep — for high-stakes or large targets. Split ledger units per subsystem and lifecycle mode, run critic waves to a clean pass, keep candidate validation and final record verification as separate fresh agents, and give prior_covered_same_source units an independent second pass.

A scoped run audits a subset: named paths, one subsystem, one companion domain, or the diff between two source refs. Seed ledger units only for in-scope surfaces and record everything else as out_of_scope — never as covered. A scoped or quick run must present itself as partial coverage.

Profiles change breadth and redundancy, never the evidence bar. Do not scale away the candidate gate, the source/local execution boundary, needs_validation discipline, schema validation, or independent verification of confirmed records.

Cost budget

The ledger makes spend countable: one unit is roughly one hunter assignment, and one surviving candidate is one or two verifier assignments depending on profile. When the user sets a budget — or the parent proposes one for a large target — record budget in run-metadata.json as a maximum number of agent invocations across all phases.

Apply the strict budget gate before launching any reconnaissance agent. Reserve the four baseline reconnaissance calls, one final post-wave critic for quick or one post-wave plus one distinct final-clean critic for standard/deep, and at least one verifier call. Add focused reconnaissance only after repeating this gate for each extra call. If the requested budget cannot fund that minimum, launch no agent: ask for a larger budget, narrower scope, or different profile. If the request remains unchanged, set run_status: "incomplete" with incomplete_reason: "budget_cannot_fund_reconnaissance_and_reserves" and report that no audit pass ran.

Spend it in this order:

  1. Count reconnaissance, every post-wave critic, and the separate final-clean critic as agent invocations.

  2. Reserve critics and validation before hunting. For quick, reserve its one post-wave final critic. Before every standard or deep hunter wave, reserve one immediate post-wave critic plus one distinct final-clean critic. Also reserve verifier cost from the profile (about 1 or 2 agents per expected candidate; when in doubt reserve 30% of the balance after critic reservation). Never assign hunters into either reserve.

  3. Assign hunters to units in priority order until the hunting allowance is spent. Spend the reserved post-wave critic immediately after that wave; keep the final-clean and validation reserves intact.

  4. Before a later wave, reserve its new post-wave critic again. If the remaining budget cannot cover the required critic calls and validation reserve, launch no hunters from that wave, mark its planned units deferred with reason budget_cannot_reserve_critics_and_validation, and use the retained final-clean critic to record the resulting gap.

Before wave 1, update the pre-recon estimate with seeded units, implied hunter count, mandatory critic calls, validation reserve, and whether the remaining budget covers the plan. If it clearly cannot, say so and propose either a tighter scope or a coarser profile instead of silently thinning evidence. If later facts consume the required final-critic reserve, launch no hunters, mark all planned work deferred, set the run incomplete with reason critic_budget_exhausted, and make no complete-coverage claim.

A strict total-agent budget can still be exceeded by an unexpectedly large candidate set or by a material Phase 5 replacement that needs another independent verifier. If the remaining budget cannot validate every candidate, stop hunting, validate candidates in fingerprint order while the budget permits, and set run_status: "incomplete" plus incomplete_reason: "validation_budget_exhausted". Keep each unvalidated fingerprint linked to a candidate ledger unit with that unresolved reason. Do not put an unvalidated candidate in findings.json, relabel it needs_validation, or report the run as complete. Phase 6 may produce a partial report only if its first section states that candidate validation is incomplete and lists the affected fingerprints and units. Never exceed a user-set strict budget silently.

Core principles

Require a boundary and result

For every candidate, name the lower-trust principal, accepted input or action, intended control, crossed boundary, affected principal or resource, and concrete observed or owner-observable result. Do not elevate a missing best practice, guessed deployment behavior, generic parser crash, or self-impact into a security finding.

Use bounded local evidence

Static analysis establishes the source path. Sandboxed local tests resolve behavior when all execution controls are available: a minimal function harness, existing unit test, small parser fixture, dummy-tenant integration test, locally rendered configuration, or bounded isolated-loopback client. Stop at a wrong return value, unauthorized dummy record, sanitizer finding, policy difference, or other minimum effect. Do not extend the local check beyond the minimum boundary result or produce persistence, post-fault, or concealment material.

Respect source visibility

Deployment controls, proxy behavior, provider settings, browser headers, identity policy, broker ACLs, packaging, and topology are real controls. If they are required and absent from the repository, do not assume either presence or absence. Use needs_validation with the exact missing fact and a safe owner-observed or local plan.

Separate priority from certainty

Only confirmed records receive severity. Likelihood and impact must reflect the demonstrated conditions and result; overall severity cannot exceed demonstrated impact. needs_validation means a specific source-grounded boundary hypothesis is blocked, not a low-confidence confirmed vulnerability, and it has no severity.

Calibrate overall severity with these anchors:

  • critical — an unauthenticated actor gains code execution, full data-store access, or takeover of arbitrary accounts.

  • high — an actor fully defeats an explicit security control with real consequences: authentication bypass, cross-tenant read or write, stored script execution affecting other users, authenticated code execution, or an unauthenticated remote stop of a shared service.

  • medium — a real boundary violation with limited blast radius, uncommon preconditions, or consequences confined to a narrow resource set.

  • low — disclosure of non-secret internals, or an effect requiring sustained effort for minimal gain.

  • informational — a confirmed but minimal-impact observation, useful mainly as a prerequisite inside a larger finding.

The high/medium discriminator: does the demonstrated result fully defeat an explicit control for an action with real consequences, or only weaken it? If you cannot state the concrete damage, the severity is lower than it feels.

Recommend the smallest effective source fix

For each confirmed finding, identify the invariant the code must enforce and the narrowest source change that enforces it at the last trusted decision point. Prefer specific repository-relative changes and regression tests over generic hardening advice. The audit describes fixes; it does not modify target source.

Full audit workflow

In full audit mode, follow all six phases in order:

  1. Reconnaissance — map the source, trust boundaries, local build paths, companion selections, prior evidence, and initial deterministic coverage ledger with RECONNAISSANCE.md.

  2. Coverage-led hunting waves — assign isolated hunters from the ledger and collect structured candidate results with HUNTING.md, ATTACK-CLASSES.md, and the selected domain companions.

  3. Candidate validation — consolidate fingerprints and give every candidate to a fresh source verifier as defined in VALIDATION-AND-REPORTING.md.

  4. Structured output — write all final confirmed, needs_validation, and rejected records to findings.json; validate it with report-schema.json and validate-findings.cjs, and validate the coverage claim with validate-coverage-ledger.cjs.

  5. Independent record verification — use fresh agents to verify final source claims and reconcile corrections or state changes.

  6. Target-neutral report — derive REPORT.md, FINDINGS-DETAIL.md, and NEEDS-VALIDATION.md from the final records, with no live-probe instructions.

Do not end the run before one of exactly two terminal states: (a) all Phase 6 artifacts are written and both validators pass, or (b) run_status: "incomplete" is recorded with its exact reason and the gap is disclosed in the report. Never stop mid-phase.

Anti-patterns

  1. Checklist deviations presented as vulnerabilities.

  2. Defense-in-depth advice with no reachable boundary violation.

  3. Live or shared-environment testing where bounded local evidence is insufficient.

  4. Guessing provider, proxy, browser, identity, or deployment behavior not present in source.

  5. Treating intended same-principal authority or self-impact as a cross-boundary result.

  6. Reporting a parser or runtime effect stronger than the observed effect.

  7. Emitting prose-only hunter results that cannot be deduplicated or verified.

  8. Re-reporting carried same-source prior confirmed records or using them as exemplars that anchor the hunt.

  9. Assigning severity to needs_validation records.

  10. Writing the report before independent verification or letting prose and JSON disagree.

Files

ATTACK-CLASSES.md

Attack Classes

Attack classes — choose and split based on Phase 1

Select attack classes relevant to the application type. Not every class applies to every codebase. The list below is a starting point; add application-specific classes from Phase 1 and split large codebases per subsystem. Frame work as finding, validating, fixing, and prioritizing vulnerabilities. Keep validation to source review and bounded local fixtures; do not develop payload chains, test availability on live services, or take action in shared environments.

Use confirmed only when source evidence and bounded validation establish the full boundary and meaningful result. Use needs_validation when a specific deployment, provider, platform, identity, or runtime fact is unavailable; state the missing fact and the safe owner-observed or local check that resolves it.

Native / binary / kernel targets (C/C++/Rust-unsafe, kernel modules, parsers and decoders, FFI, concurrent runtimes, binary loaders, JITs, firmware): use the memory-safety, integer/ABI, concurrency, binary-loader, and privileged-interface classes in MEMORY-SAFETY-AND-BINARY.md.

AI / LLM / agent targets (chatbots, RAG, persistent memory, tool-calling agents, MCP servers/clients, prompt assembly, or model-controlled actions): use the context, memory-poisoning, action-binding, tool-schema, MCP-identity, and output classes in AI-AND-LLM.md.

HTTP, web, and identity targets (ordinary web apps, APIs, reverse proxies, CDNs, gateways, custom HTTP parsers, sessions, CSRF, JWT, OAuth/OIDC, SAML, MFA, passkeys, account recovery/linking, API keys, or mTLS): use WEB-PROTOCOL-AND-AUTH.md.

Client-side and browser targets (SPAs, browser extensions, embedded webviews, service workers, browser storage, cross-window messaging, CORS, WebSockets, or DOM rendering): use CLIENT-SIDE.md.

Supply-chain and release targets (dependency resolution, generated inputs, CI, release/signing/promotion, updates, plugins, or extensions): use SUPPLY-CHAIN-AND-RELEASE.md.

Cloud and deployment targets (IAM, infrastructure as code, containers/Kubernetes, service mesh, serverless/edge, ingress, provider events, or runtime configuration): use CLOUD-AND-DEPLOYMENT.md.

Protocol, RPC, and messaging targets (gRPC, GraphQL transports, Protobuf/Cap'n Proto/Thrift, custom protocols, queues, brokers, pub/sub, webhooks, or streaming RPC): use PROTOCOLS-RPC-AND-MESSAGING.md.

Resource-exhaustion and availability targets (untrusted work can consume shared CPU, memory, disk, connections, workers, queues, quotas, or operator-owned spend): use RESOURCE-EXHAUSTION-AND-AVAILABILITY.md.

Data-isolation and lifecycle targets (multi-tenant stores, caches/search, object links, analytics, export/backup, migration, deletion, retention, or restore): use DATA-ISOLATION-AND-LIFECYCLE.md.

Desktop, mobile, and local-IPC targets (native apps, deep links, webview bridges, exported components, privileged helpers, local daemons, Unix sockets/XPC/Binder/D-Bus): use DESKTOP-MOBILE-AND-LOCAL-IPC.md.

Injection (subagent_type: general) Trace untrusted input from entry point to dangerous sink. What counts as a "dangerous sink" depends on the application:

  • Web apps: SQL queries, HTML output, shell commands, template engines, file paths, HTTP redirects, deserialization

  • Libraries: any function that processes caller-supplied data without validation — buffer operations, parsers, format strings

  • CLI tools: shell command construction, file path handling, environment variable interpolation

  • Services: query construction, message serialization, log injection, LDAP/XPATH queries

  • Client-side (browser/JS): DOM XSS, prototype pollution, postMessage/origin trust, and other browser-side classes — covered by the CLIENT-SIDE.md companion blocks when selected

Do not stop at the obvious direct paths. Look for indirect injection: data stored safely, then retrieved and used in a dangerous context by different code. Look for injection through field names, keys, headers, and metadata — not just values. Look for injection into secondary systems (logs, caches, search indexes, analytics).

Access control (subagent_type: general) Verify that a caller cannot do something outside its authority. Go beyond checking whether permission checks exist — verify they check the right permission for the right resource via the right mechanism:

  • Is there a path to the same state change that checks a different (weaker) permission?

  • Can a field in the request body override what the permission system intended to restrict?

  • Are there endpoints that gate on authentication but forget authorization?

  • Does the same resource have multiple access paths with inconsistent checks?

  • What about bulk/batch/export/import operations — do they enforce per-item permissions?

For complex access models, split into separate agents for auth bypass vs authorization logic.

Resource and file handling (subagent_type: general)

  • Path traversal (reading/writing outside intended directories) — including through symlinks, encoded sequences, and null bytes

  • SSRF (making the application fetch attacker-controlled URLs) — including through redirects, DNS rebinding, and URL parser differentials

  • Unsafe deserialization, archive extraction (zip slip), temp file handling

  • Memory safety (if applicable): buffer overflows, use-after-free, integer overflow

  • Race conditions on file operations (TOCTOU between check and use)

Cryptography and secrets (subagent_type: general)

  • Weak randomness for security-critical values (tokens, keys, nonces)

  • Hardcoded secrets, secrets in logs, error messages, URLs, or client-visible responses

  • Broken key derivation, missing HMAC verification, nonce reuse

  • Timing side-channels on secret comparison

  • Misuse of crypto primitives (ECB mode, unauthenticated encryption, static IVs, etc.)

  • What happens when crypto operations fail? Does the error path fall back to no-crypto?

Business logic (subagent_type: general) Hunt logic errors by hand: standard scanners cannot find them, and they yield high-impact findings. For each major workflow:

  • State machine violations: Can you skip steps? Go backwards? Reach an invalid state? What happens if you replay a completed flow? What about partial failure — if step 2 of 3 fails, is step 1 rolled back?

  • Race conditions with business impact: Concurrent operations that produce invalid states (double-spend, double-approve, lost updates). Focus on operations that check-then-act non-atomically.

  • Numeric/quantity manipulation: Negative values, zero values, overflow, precision loss, type coercion between string and number.

  • Access boundary violations: Not "does the permission check exist" but "is it the right check for the business rule?" Can input to one operation bypass a restriction enforced on a different operation for the same effect?

  • Implicit trust assumptions: Data from storage, config, other components, or plugins assumed safe because "we validated it on the way in." What if a different code path wrote it?

  • Time-based logic: Expiry checks, scheduling, rate windows, clock skew. What happens at exact boundary moments? What about timezone differences between components?

  • Default and fallback behavior: What is the security posture when config is missing? When a feature flag is off? When a dependency is unavailable? When the system is mid-migration?

Feature abuse and data leakage (subagent_type: general) Legitimate features used for unintended purposes. Look for bugs in the design, not only in the code:

  • Export/backup as exfiltration: Can a low-privilege user trigger an export, snapshot, or backup that includes data above their access level? Can they export other users' data? Does the export include deleted/draft/private content? Revision history that was supposed to be pruned?

  • Import/restore as injection: Can import overwrite existing data? Can it create records that bypass normal validation? Can it inject content into collections the user has no write access to? Does it respect the same permission model as the UI?

  • Search/filter/sort as oracle: Can search queries reveal whether content exists that the user cannot directly access? Do filter parameters let users probe statuses, roles, or fields they should not know about? Does sorting by a hidden field reveal its values through result ordering?

  • Enumeration through side effects: Do error messages differ between "does not exist" and "no access"? Do response times differ? Response sizes? HTTP status codes? Can you enumerate users through password reset, invite, or registration flows?

  • Preview/draft/staging leakage: Are preview tokens scoped to one item or do they unlock broader access? Can draft content be discovered through search, RSS feeds, sitemaps, or API listing endpoints? Can cache headers cause a CDN to serve private content publicly?

  • Notification/webhook as SSRF: Can a user set a notification URL, webhook URL, or callback URL that the server fetches? Is it validated against internal networks? What about after a redirect?

Chained vulnerabilities and trust boundaries (subagent_type: general) Individually allowed or contained behavior can become a vulnerability when another component or lifecycle step relies on a stronger guarantee:

  • Multi-step boundary failures: Map what a low-privilege principal may read, write, invoke, and retain, then connect only concrete outputs to later trust decisions. Confirm each prerequisite and do not assume a downstream effect.

  • Cross-component trust gaps: Component A validates input and passes it to component B. Compare the exact guarantee A produces with what B assumes, including truncation, type coercion, normalization, tenant scope, and plugin/extension access.

  • Second-order use: Data safe when stored may become dangerous in a later context. A field name becomes a JSON path, a slug becomes a file path, escaped text enters raw rendering, or a stored string becomes a URL, regex, template, or policy expression.

  • Scope and capability growth: Token, API-key, plugin, OAuth, MCP, or AI capabilities become broader after delegation, refresh, caching, role change, or composition. Name the concrete operation the resulting principal should not have.

  • Timing and ordering: Review setup, migration, soft-delete, revoke/cache expiry, check/use, and validate/consume windows. Confirm stale state is accepted before reporting.

  • Rollback and recovery: Undelete, restore, revision rollback, and cancellation must apply current ownership, validation, and authorization. Confirm which invalid state is restored.

Wildcard (subagent_type: general) You are not given a category. Find vulnerabilities outside the standard classes already assigned.

Read code that looks boring or disconnected from security. Follow incomplete, experimental, compatibility, and fallback features, but retain the same concrete boundary and validation requirements as every other class.

Use these starting points, but do not limit yourself to them:

  • What is the strangest code in the codebase? Why does it exist? What happens if it is abused?

  • Are there any features that feel half-finished, experimental, or bolted on? Those have the weakest security because they got the least review.

  • What happens if you use the API in a way the frontend never would? The UI constrains users, but the API does not. What API calls are possible but never made by the client?

  • Are there any hidden or undocumented endpoints, parameters, headers, or features? Look at route registrations, middleware, and config for things that are not in the docs.

  • What happens when you mix features that were not designed to work together? Localization + preview + caching. Import + plugins + webhooks. OAuth + impersonation + API keys.

  • Is there anything interesting in the git history? Reverted security fixes, commented-out auth checks, secrets that were committed then removed (still in history).

  • Which valid-account actions affect other users, shared integrity, availability, or operator-owned cost? Verify containment, quotas, authorization, and recovery around those actions.

  • Which operations are irreversible or require elevated confirmation? Bind authorization and approval to the final principal, action, and resource.

  • What assumptions does the code make about the environment? That the database is local, that the clock is accurate, that DNS is trustworthy, that the filesystem is case-sensitive?

  • Look at the test files — what are they not testing? Compare the edge cases the developer thought about (tests exist) with the ones they did not (no tests).

Pursue anomalies inside your assigned scope until the invariant is settled. If something looks strange, read it until you can state whether it is safe. If a function has a comment explaining why it is safe, verify the explanation. If a variable is named temp or hack or legacy, read it closely.

Obvious things (subagent_type: general) Other agents hunt subtle bugs. This agent checks the basic exposures that are easy to overlook because everyone assumes someone else already checked them:

  • Are there any hardcoded passwords, API keys, tokens, or secrets in the source? (grep for password, secret, apikey, token, Bearer, -----BEGIN, common default passwords)

  • Are there any TODO/FIXME/HACK/XXX comments that reference security? (TODO: add auth, FIXME: validate input, HACK: skip permission check)

  • Is debug mode / dev mode properly gated? Can it be enabled in production via environment variable, query parameter, or header?

  • Are there test/example/seed credentials that work in production?

  • Is there a /debug, /admin, /test, /status, /health, /metrics, /env, /.env, /config endpoint that is unprotected?

  • Are there any .env, .env.local, credentials.json, *.pem, *.key files checked into the repo?

  • Does the .gitignore actually cover secrets, uploads, and local config?

  • Are dependencies pinned? Are there known CVEs in the dependency tree? (check lockfiles)

  • Are there any eval(), exec(), child_process, Function(), vm.runInContext, import() with dynamic input?

  • Are CORS headers set to * or overly permissive? Is Access-Control-Allow-Credentials combined with a wildcard origin?

  • Are cookies missing HttpOnly, Secure, or SameSite attributes?

  • Are there any open redirects? (parameters named redirect, return, next, url, goto, continue that feed into redirects without validation)

  • Is TLS enforced? Are there any HTTP-only endpoints?

  • Are error responses in production returning stack traces, internal paths, or SQL errors?

This agent does not need to be creative. It needs to be thorough and literal. Check every item. Report each result.

Important: For any finding this agent reports, it must verify the full code path, not just surface appearance. If a cookie is missing HttpOnly, check whether the cookie contains security-sensitive data and whether JS needs to read it by design. If an error message contains a field name, check whether the field is ever actually populated with sensitive data. A flag is not a finding — trace the impact before reporting.

Requirements and compatibility

Written for: Claude Code

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Names Claude Code tools, Needs Node.js

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Cloudflare
Publisher
Cloudflare (Official)
Source
cloudflare/security-audit-skill · skills/security-audit · commit c1c8a8c
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Cloudflare.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download security-audit.zip