code-security-audit

A structured process for reviewing source code for security vulnerabilities. It traces data from where it enters a program to where it reaches a risky operation, and checks areas such as injection, authentication, and authorization.

In plain words
What is it for?
Use it for quick, standard, or deep security reviews covering issues such as SQL injection, command injection, cross-site scripting, token handling, permissions, and encryption.
Why use it?
It helps identify security risks with evidence from the code instead of assuming that a framework or pattern is unsafe.

Skill for Claude CodeCodexCursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/programmeranthony/expert-coding-harness/code-security-audit
Any agent
npx skills add ProgrammerAnthony/Expert-Coding-Harness --skill code-security-audit
Clone the repo
git clone --depth 1 https://github.com/ProgrammerAnthony/Expert-Coding-Harness

Made for: Claude Code, Codex, Cursor.

Per session 128 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,036 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00128 $0.03036
Opus 5 $0.00064 $0.01518
Sonnet 5 $0.00026 $0.00607
Haiku 4.5 $0.00013 $0.00304

Measured 2d ago against content hash d98d2b80f5dd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-security-audit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/skills/code-security-audit/SKILL.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

代码安全审计专家

铁律:所有漏洞发现必须有代码路径证据。 禁止基于"典型框架通常有此漏洞"等假设报告漏洞,未找到完整调用链的必须标记为"疑似,需人工验证"。

Inputs / Outputs / Gates / Handoffs(统一契约)

  • Inputs(最小输入):目标仓库/目录;技术栈线索(语言/框架/运行方式);审计范围(模块/commit/接口);扫描模式(Quick/Standard/Deep)。
  • Outputs(产物形态):审计计划(先)+ 结构化审计报告(后,结构参考 references/audit-report-template.md)。
  • Gates(继续前必须满足)
    • 未经用户确认范围与模式,禁止开始扫描分析(保持与本文件 HARD-GATE 一致)。
    • 结论必须有代码路径证据链(Source→Sink);不完整链路必须标为“疑似,需人工验证”。
    • 通用门控清单可复制使用:references/quality-gates-checklist.md
  • Handoffs(推荐下游)
    • writing-plans(实施计划编写):输出修复计划
    • subagent-driven-development(子代理驱动开发):按计划执行修复
    • code-security-audit(代码安全审计专家):修复后复审

审计方法:三层分析法

层次 方法 目标
Grep / 模式匹配 快速定位高风险区域,识别危险函数调用
线 Read / 逐行追踪 完整数据流追踪,Source → Sink 路径分析
推理 / 逻辑验证 确认漏洞有效性、防护可绕过性、利用条件

扫描模式

启动时询问用户选择模式(默认 Standard):

请选择扫描模式:
1. Quick(快速扫描,约 5-10 分钟)— 高危漏洞 + 敏感信息 + 已知 CVE
2. Standard(标准扫描,约 30-60 分钟)— OWASP Top 10 + 认证授权 + 加密
3. Deep(深度扫描,约 1-3 小时)— 全维度覆盖 + 攻击链 + 业务逻辑 + 合规

10 个安全维度 + 三轨模型

# 维度 审计轨道 覆盖内容
D1 注入 Sink-driven SQL/Cmd/LDAP/SSTI/SpEL/JNDI
D2 认证 Config-driven Token/Session/JWT/Filter 链
D3 授权 Control-driven CRUD 权限一致性、IDOR、水平越权
D4 反序列化 Sink-driven Java/Python/PHP Gadget 链
D5 文件操作 Sink-driven 上传/下载/路径遍历
D6 SSRF Sink-driven URL 注入、协议限制
D7 加密 Config-driven 密钥管理、加密模式、KDF
D8 配置 Config-driven Actuator、CORS、错误信息暴露
D9 业务逻辑 Control-driven 竞态条件、Mass Assignment、状态机、多租户隔离
D10 供应链 Config-driven 依赖 CVE、版本检查

五阶段审计流程

Phase 1:侦察与架构建模(约 10% 工时)

目标:建立项目全貌,产出架构图和攻击面清单。

# 技术栈识别
ls -la
find . -name "package.json" -o -name "pom.xml" -o -name "requirements.txt" -o -name "go.mod" | head -20
# 入口点识别
rg "router|app.route|@RequestMapping|@Controller|@RestController" -l
# 配置文件识别
find . -name "*.yml" -o -name "*.yaml" -o -name "*.properties" -o -name "*.env" | head -20
# 敏感信息预扫
rg -i "password|secret|api_key|token|private_key" -l

Read the full file on GitHub · 228 lines

Files

What ships with it

33 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 228 lines · 128 tokens per session scan A d98d2b80f5dd

Subscribe to this mod's changes

code-security-audit is a skill published in the GitHub repository ProgrammerAnthony/Expert-Coding-Harness (234 stars, last pushed 3mo ago), licensed MIT. It adds 128 tokens to every session and 3,036 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens