Agent skill

Auditing Code For Vulnerabilities

by trilwu in trilwu/secskills

Audit source code for exploitable vulnerabilities using threat-model-driven review, taint tracing, invariant checking, and variant analysis.

MITAuto-check passedSecurity

Install Auditing Code For Vulnerabilities

skills CLI
$ npx skills add trilwu/secskills --skill auditing-code-for-vulnerabilities -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install trilwu/secskills auditing-code-for-vulnerabilities --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/trilwu/secskills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/secskills-core/skills/auditing-code-for-vulnerabilities .claude/skills/auditing-code-for-vulnerabilities && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
auditing-code-for-vulnerabilities
GitHub stars
156
Token cost
~3.2k tokens
SKILL.md length
1,426 words
Files
2 (incl. references)
Skills in repo
50
Repo updated
First seen
Licence
MIT

At a glance

Audit source code for exploitable vulnerabilities using threat-model-driven review, taint tracing, invariant checking, and variant analysis.

  • Works in 4 steps: Reachability — name the concrete entry… → Control — show which part of the… → Impact — state what breaks: which… → …
  • Reviewing a codebase
  • SKILL.md covers When to Use, When NOT to Use, The Loop and Verification Before Reporting, plus 4 more sections
  • Calls rg, git and semgrep

What it does

Auditing Code For Vulnerabilities is an agent skill from trilwu/secskills. Audit source code for exploitable vulnerabilities using threat-model-driven review, taint tracing, invariant checking, and variant analysis. Use when reviewing a codebase or diff for security bugs, performing a security audit, hunting for vulnerabilities in a target's source, or validating whether a suspected finding is real.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/bug-class-checklist.md`).

It sits in Security, covering Threat modeling and Security review. It works with PHP. The repository describes itself as: Transform Claude Code into your personal security engineer. The licence is MIT.

When your agent uses it

  • Reviewing a codebase
  • Diff for security bugs
  • Performing a security audit
  • Hunting for vulnerabilities in a targets source

Example prompts

  • “/auditing-code-for-vulnerabilities”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Reachability — name the concrete entry point and the caller privilege
  2. Control — show which part of the dangerous value the attacker controls.
  3. Impact — state what breaks: which invariant from Pass 1, and what an
  4. No mitigating control — check for a WAF rule, a framework default, a

What it can do on your machine

Read from SKILL.md and the folder at commit ca53957. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • rg
    • git
    • semgrep
    • cargo
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Auditing Code For Vulnerabilities loads about 3.2k tokens when it runs, and up to ~4.7k if it reads all its reference files. Until then it costs about 90 tokens; SKILL.md has 1,426 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~90
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from trilwu/secskills at commit ca53957, republished under its MIT licence (© trilwu). 1,426 words, ~3,203 tokens.

Download SKILL.mdSave it as .claude/skills/auditing-code-for-vulnerabilities/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
auditing-code-for-vulnerabilities
description
Audit source code for exploitable vulnerabilities using threat-model-driven review, taint tracing, invariant checking, and variant analysis. Use when reviewing a codebase or diff for security bugs, performing a security audit, hunting for vulnerabilities in a target's source, or validating whether a suspected finding is real.
verified
2026-07-28

Auditing Code for Vulnerabilities

Finding real bugs in source code is a different job from running a scanner. A scanner matches patterns; an auditor builds a model of what the code is supposed to guarantee and then hunts for the paths where that guarantee breaks. This skill is the methodology for the second job.

When to Use

  • Auditing a repository, service, or library for security defects
  • Reviewing a diff, branch, or pull request for introduced vulnerabilities
  • Hunting for a specific bug class across a large codebase
  • Validating whether a scanner finding or a reported vulnerability is real
  • Building an audit plan and coverage report for a client engagement

When NOT to Use

  • Black-box testing of a running app — use testing-web-applications or testing-apis
  • A PHP codebase specifically (type juggling, unserialize/phar POP chains, php:// wrappers) — this methodology plus auditing-php-applications
  • Hunting a planted webshell or backdoor rather than a vulnerability — use hunting-web-backdoors
  • Binary-only targets — use analyzing-binaries
  • Dependency and build-pipeline risk — use auditing-supply-chain
  • Cryptographic construction review — use reviewing-cryptography
  • Writing up finished findings — use reporting-security-findings
  • Running a multi-agent discovery campaign across a whole target with builder/critic separation and iteration — use orchestrating-vulnerability-research, which dispatches this skill as the per-slice hunter

The Loop

Auditing is four passes, not one. Do not skip to pass 3.

1. Context      → what does this system protect, and from whom?
2. Attack surface → where does untrusted input enter, and what does it reach?
3. Hunt          → trace specific bug classes along those paths
4. Verify        → prove exploitability before you write a word
Pass 1: Build context before reading code

Do not open files at random. Spend the first block of effort answering:

QuestionWhere to look
What are the security-relevant assets?README, docs, data models, DB schema
Who are the actors and trust tiers?Auth middleware, role enums, tenant models
What are the stated invariants?Tests, assertions, comments containing "must", "never", "invariant"
What has already been fixed here?git log --grep for security keywords, CVE files, SECURITY.md
What is out of scope?Engagement brief, vendor code, generated files
bash
# Prior security work is the cheapest source of bug leads
git log --oneline --grep='security\|CVE\|vuln\|injection\|auth bypass\|overflow' -i | head -40

# Stated invariants often mark where the author was nervous
rg -n --stats 'MUST NOT|must never|SECURITY|XXX|HACK|TODO.*(auth|secur|valid)' -i

# Where does privilege actually get checked?
rg -n 'is_admin|require_role|authorize|has_permission|@login_required|checkAccess'

Write a short target model before hunting: assets, actors, trust boundaries, and the three invariants whose violation would matter most. Everything after this is a search for counterexamples to those invariants.

Pass 2: Map the attack surface

Enumerate entry points, then rank them. An entry point matters in proportion to how far it reaches before it is validated.

bash
# HTTP/RPC routes
rg -n '@(app|router)\.(get|post|put|delete|patch)|app\.(get|post)\(|@RequestMapping|http\.HandleFunc'

# Deserialization, template rendering, and dynamic execution sinks
rg -n 'pickle\.loads|yaml\.load\(|Marshal|unserialize|ObjectInputStream|eval\(|new Function|exec\(|Runtime\.getRuntime'

# Command, SQL, and path sinks
rg -n 'os\.system|subprocess.*shell\s*=\s*True|child_process\.exec\(|execSync|Statement\.execute|\.raw\(|fmt\.Sprintf.*SELECT'

# Where authentication is decided rather than enforced
rg -n 'verify=False|InsecureSkipVerify|jwt\.decode\(.*verify.*False|algorithms=\[.*none'

Rank entry points by: reachable without authentication > reachable by a low privilege tier > reachable only by an admin. Then follow the highest-ranked ones inward. Depth beats breadth — one fully traced path is worth twenty grep hits.

Grep hits are candidates, not findings. The commands above are a cheap wide net; each match is an unresolved lead until you have traced it. Persist the candidate set — a worklist of (file:line, bug class, entry point) — and drive every entry to an explicit verdict: traced-safe, confirmed, or needs-PoC. Widen the net cheaply, then spend expensive reasoning per candidate — never the reverse. The failure mode is not a missing grep pattern; it is enumerating fifty candidates, eyeballing five, and calling the tree clean. On a large codebase, fold the project's own conventions into the net — its ORM's raw-query escape hatch, its auth decorator's name, its templating call — because the highest-yield sinks are the ones generic patterns miss.

Pass 3: Hunt bug classes along the traced paths

For each promising path, trace taint from source to sink and ask what the code assumes. The high-yield classes, in rough order of how often they survive to production:

Authorization, not authentication. Most real breaches are missing object level checks, not broken login. For every handler that takes an ID, ask: is the object scoped to the caller's tenant/user, or only looked up by ID? Check the query, not the decorator.

Trust-boundary confusion. Data validated at one layer and re-parsed at another. Look for values that cross a serialization boundary — a validated string re-parsed as a URL, a path, a template, or a query.

State and concurrency. Check-then-use gaps, non-atomic balance updates, idempotency keys that are not actually unique, retry paths that replay side effects. Search for reads followed by writes with no lock or transaction.

Injection into a secondary interpreter. SQL, shell, LDAP, XPath, template engines, log formats, and regex. The question is never "is there a filter" but "does the filter and the interpreter agree on the grammar."

Memory safety (C/C++/unsafe Rust/CGo). Length arithmetic before bounds checks, memcpy with an attacker-influenced size, off-by-one in loop bounds, signed/unsigned conversions, use-after-free on error paths.

Error and cleanup paths. The happy path is usually reviewed; the except, catch, defer, and goto fail branches are not. Audit them specifically.

Secrets and cryptographic misuse. Hardcoded keys, non-constant-time comparison of tokens, predictable IDs from Math.random/rand(), missing signature verification. Deep crypto review belongs in reviewing-cryptography.

Pass 4: Variant analysis

A bug is a template, not an incident. When you confirm one, immediately search for its siblings — the same mistake made by the same author, the same copied block, the same missing check on a neighbouring route.

bash
# You found one unscoped lookup. Find every other one.
rg -n 'find_by_id|findOne\(\{ *_id|get_object_or_404' -A3 | rg -v 'tenant|owner|user_id'

Variant analysis is where audits produce disproportionate value. Budget time for it explicitly — roughly one unit of variant search per confirmed finding.

Verification Before Reporting

A finding you cannot demonstrate is a hypothesis. Before it goes in the report, answer all four:

  1. Reachability — name the concrete entry point and the caller privilege required. "An attacker who can reach POST /api/export unauthenticated."
  2. Control — show which part of the dangerous value the attacker controls.
  3. Impact — state what breaks: which invariant from Pass 1, and what an attacker gains.
  4. No mitigating control — check for a WAF rule, a framework default, a middleware, a DB constraint, or a caller that already sanitizes.

If a proof of concept is in scope, write the smallest one that proves control of the sink — not a weaponized exploit.

Show full SKILL.md (536 more words)Show less
Revalidate to prune false positives

The four checks above confirm a finding; this pass tries to kill it. Run it on every confirmed candidate before it reaches the report — a report's credibility is set by its worst false positive, not its best true finding.

  • Is it already fixed? The tree you are reading may lag the fix, or the fix may sit on a branch you have not pulled. Confirm the vulnerable code is what actually ships before you file it.

    bash
    git log -S'<dangerous token>' --oneline -- <file>   # when this line changed, and toward what
    git log --oneline <checkout>..origin/main -- <file> # a fix on main you are not reading
    git blame -L <line>,<line> <file>                    # the commit that introduced it, for context
  • Re-derive it adversarially. Argue the opposite case: assume the code is safe and go find the control that makes it so — the middleware, the DB constraint, the caller that already sanitizes. A finding that survives a genuine attempt to disprove it is one you can defend.

  • Confirm the sink still receives your value. Re-trace the last hop. A refactor often slips a validator or an encoder between source and sink that a first read glides past.

Drop what dies here, and say so in your coverage notes. A candidate you cannot revalidate is a note to yourself, not a finding.

Rationalizations to Reject

These are the thoughts that turn an audit into a formality. Each one is wrong.

  • "It's probably validated upstream." Then go read upstream. Unverified assumptions about a caller are the single most common source of missed bugs.
  • "The framework handles that." Frameworks handle the default path. Check the version, check the config, check whether this call uses the safe API.
  • "That input is internal." Internal today. Trace how it is populated; a queue consumer or admin import is usually reachable from outside.
  • "It's only exploitable by an authenticated user." That is a severity input, not a reason to drop the finding.
  • "It looks intentional." Intent is not a control. Note the intent, keep the finding.
  • "The scanner didn't flag it." Scanners find what they have rules for.
  • "I confirmed it, so it's real." You confirmed it against one checkout and your own first read. Revalidate it against what actually ships and against a genuine attempt to disprove it before it goes in the report.
  • "I've reviewed enough files." Coverage is measured against the attack surface you mapped in Pass 2, not against file count.

Tool Assist, Not Tool Substitute

Static analysis is for coverage and for variant search after you know the pattern. Write a rule once you have a confirmed bug, and let it find the rest.

bash
# Semgrep: broad pass, then a rule you write for your specific finding
semgrep --config=auto --severity=ERROR --json -o semgrep.json .
semgrep --config=./rules/my-variant-rule.yaml .

# CodeQL for dataflow questions grep cannot answer
codeql database create db --language=<lang> && codeql database analyze db --format=sarif-latest -o out.sarif

# Language-specific
bandit -r . -f json            # Python
gosec -fmt=json ./...          # Go
cargo audit && cargo geiger    # Rust deps + unsafe surface
npm audit --json               # JS deps

Triage every tool finding through the four verification questions above. A report of unverified scanner output is worse than no report — it burns the reader's trust and buries the real bugs.

Audit Deliverable

Track coverage as you go, and state it honestly:

markdown
## Coverage
| Component | Files | Depth      | Notes                          |
|-----------|-------|------------|--------------------------------|
| auth/     | 12    | Full trace | All routes traced to sinks     |
| billing/  | 30    | Partial    | Webhook handlers only          |
| vendor/   | -     | Excluded   | Out of scope per brief         |

## Findings
F1. [High] Tenant isolation bypass in GET /api/reports/:id — <impact> — <repro>

Say what you did not cover. An audit that claims full coverage it did not achieve is the most damaging artifact you can produce.

References

  • references/bug-class-checklist.md — per-language hunting checklists
  • reporting-security-findings — severity scoring and write-up format
  • OWASP Application Security Verification Standard (ASVS) for requirement-driven review
  • CWE Top 25 and the CWE hierarchy for classification

© trilwu, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in secskills-core/skills/auditing-code-for-vulnerabilities of trilwu/secskills.

  • SKILL.md
  • references/bug-class-checklist.md

Open the folder on GitHubat commit ca53957

Compare with similar skills

Auditing Code For Vulnerabilities next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Auditing Code For Vulnerabilities compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Auditing Code For Vulnerabilities this skilltrilwu/secskills156—~3.2kAutomated safety check: PassMIT
Commit Security Scancodexstar69/bug-hunter519—~629Automated safety check: PassMIT
Threat Mitigation Mappingwshobson/agents40k8 repos~742Automated safety check: PassMIT
Audit Browser Security Boundariesnordstjernen-web/northstar-browser116—~920Automated safety check: PassGPL-3.0
Security Auditblueberrycongee/termcanvas406—~966Automated safety check: NotesMIT
Security Reviewcodexstar69/bug-hunter519—~567Automated safety check: PassMIT

Similar skills

  • Commit Security Scan

    codexstar69/bug-hunter

    Scan code changes for security vulnerabilities using Bug Hunter-native artifacts and STRIDE context.

    519 GitHub stars~629 tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Match identified threats to preventive, detective and corrective controls across network, application, data, endpoint and process layers to plan remediation.

    40k GitHub starsUsed in 8 repos~742 tokens
    SecurityAuto-check passed
  • Audit Browser Security Boundaries

    nordstjernen-web/northstar-browser

    Audit browser-engine changes that process untrusted content or cross native-memory, origin, network, storage, extension, decoder, sandbox, or operating-system boundaries.

    116 GitHub stars~920 tokensUpdated 2 days ago
    SecurityAuto-check passed
  • Security Audit

    blueberrycongee/termcanvas

    Security audit skill. An agent skill from blueberrycongee/termcanvas.

    406 GitHub stars~966 tokensUpdated 4 mo ago
    SecurityAuto-check: notes
  • Security Review

    codexstar69/bug-hunter

    Run a focused STRIDE-based security review using Bug Hunter-native artifacts.

    519 GitHub stars~567 tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Commit Security Scan

    Factory-AI/factory-plugins

    Analyze code changes for security vulnerabilities using LLM reasoning and threat model patterns.

    110 GitHub stars~2.3k tokensUpdated yesterday
    SecurityAuto-check passed

More from trilwu/secskills

All 50 skills in this repo
  • Perform OSINT, subdomain enumeration, port scanning, web reconnaissance, email harvesting, and cloud asset discovery for initial access.

    156 GitHub stars~3.1k tokensUpdated 1 mo ago
    Auto-check: notes
  • Securing AI Systems

    trilwu/secskills

    Assess and harden LLM applications and agentic systems against prompt injection, tool misuse, excessive agency, memory poisoning, RAG data leakage, and model supply-chain risk, mapped to the OWASP…

    156 GitHub stars~2.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Analyzing Binaries

    trilwu/secskills

    Reverse engineer compiled binaries, firmware, and mobile app packages using triage, static disassembly, decompilation, and dynamic instrumentation.

    156 GitHub stars~2.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Analyzing Go Binaries

    trilwu/secskills

    Reverse engineer Go binaries by recovering function names and types from pclntab and moduledata using GoReSym, redress, and IDA/Ghidra Go plugins, and by reading Go's non-standard calling…

    156 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed
  • Analyzing iOS Binaries

    trilwu/secskills

    Analyze iOS applications at the binary level — decrypting FairPlay-protected IPAs with frida-ios-dump or bagbak, inspecting Mach-O load commands, recovering Objective-C headers with class-dump, and…

    156 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed
  • Analyzing Malware

    trilwu/secskills

    Analyze suspected malware safely — containment, static triage, sandboxed detonation, unpacking, capability and C2 extraction, IOC production, and YARA rule authoring.

    156 GitHub stars~3.6k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Auditing Code For Vulnerabilities

What does Auditing Code For Vulnerabilities do?

Audit source code for exploitable vulnerabilities using threat-model-driven review, taint tracing, invariant checking, and variant analysis. Auditing Code For Vulnerabilities is an agent skill from trilwu/secskills. Audit source code for exploitable vulnerabilities using threat-model-driven review, taint tracing, invariant checking, and variant analysis.

When should I use Auditing Code For Vulnerabilities?

Auditing Code For Vulnerabilities fits situations like: reviewing a codebase; diff for security bugs; performing a security audit; hunting for vulnerabilities in a targets source.

How do I install Auditing Code For Vulnerabilities in Claude Code?

Run `npx skills add trilwu/secskills --skill auditing-code-for-vulnerabilities -a claude-code`. Or copy the skill folder (secskills-core/skills/auditing-code-for-vulnerabilities in trilwu/secskills) into .claude/skills/auditing-code-for-vulnerabilities in your project. Claude Code loads it when a task matches its description.

How do I install Auditing Code For Vulnerabilities in Codex?

Run `npx skills add trilwu/secskills --skill auditing-code-for-vulnerabilities -a codex`. Or copy the skill folder (secskills-core/skills/auditing-code-for-vulnerabilities in trilwu/secskills) into .agents/skills/auditing-code-for-vulnerabilities in your project. Codex loads it when a task matches its description.

Can I use Auditing Code For Vulnerabilities in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add trilwu/secskills --skill auditing-code-for-vulnerabilities -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/auditing-code-for-vulnerabilities, .gemini/skills/auditing-code-for-vulnerabilities, .github/skills/auditing-code-for-vulnerabilities and .opencode/skills/auditing-code-for-vulnerabilities in your project.

What does Auditing Code For Vulnerabilities need to run?

Going by SKILL.md and its folder, Auditing Code For Vulnerabilities needs the command-line tools its instructions call (rg, git, semgrep, cargo and npm). Our summary lists: Python 3.

Does Auditing Code For Vulnerabilities access the network?

SKILL.md contains no URLs. Its commands use git and npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Auditing Code For Vulnerabilities safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Auditing Code For Vulnerabilities use?

Auditing Code For Vulnerabilities is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Auditing Code For Vulnerabilities use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.5k tokens, read only when the agent opens those files.

What are the alternatives to Auditing Code For Vulnerabilities?

Skills that share tags, products or a category with Auditing Code For Vulnerabilities: Commit Security Scan (codexstar69/bug-hunter, 519 stars), Threat Mitigation Mapping (wshobson/agents, 40k stars), Audit Browser Security Boundaries (nordstjernen-web/northstar-browser, 116 stars) and Security Audit (blueberrycongee/termcanvas, 406 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Auditing Code For Vulnerabilities?

trilwu (a GitHub user) maintains it in trilwu/secskills, which has 156 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on September 4, 2026.

Source: trilwu/secskills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.