vuln-scan
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/vuln-scan
/vuln-scan
Static vulnerability review of a source tree. Produces
(+ a human-readable ) that ingests directly.
VULN-FINDINGS.json.md/triageThis skill does not execute code. It reads source and reasons about it.
For execution-verified findings (ASAN crashes, reproducing PoCs), point the
user at — see README Step 2.
vuln-pipeline run <target>Tool fallbacks. Prefer the dedicated Glob and Grep tools. Some sessions
do not provision them — is a permission filter, not a loader,
so listing them here does not make them appear. When Glob/Grep are
unavailable, fall back to the read-only Bash commands whitelisted above:
/ for enumeration, / for
search, / / for sniffing. These are the ONLY permitted
Bash commands; do not write helper scripts or pipe target content into a
shell interpreter.
allowed-toolsrg --files <scope>ls -Rrg -ngrep -rnwcheadfile针对源代码树的静态漏洞审查工具。生成(以及一份人类可读的文件),供/triage工具直接导入使用。
VULN-FINDINGS.json.md本技能不执行代码。仅读取源代码并进行逻辑分析。如需执行验证的检测结果(如ASAN崩溃、可复现的PoC),请引导用户使用——详见README第2步。
vuln-pipeline run <target>工具降级方案:优先使用专用的Glob和Grep工具。部分会话可能未配置这些工具——是权限过滤器而非加载器,因此在此处列出并不会使其生效。当Glob/Grep不可用时,降级使用上述白名单中的只读Bash命令:使用/进行枚举,使用/进行搜索,使用//进行内容探测。这些是唯一允许使用的Bash命令;请勿编写辅助脚本或将目标内容传入Shell解释器。
allowed-toolsrg --files <scope>ls -Rrg -ngrep -rnwcheadfileArguments
参数
- (required) — directory to scan. Relative or absolute.
<target-dir> - — scan only this focus area (repeatable). Skips recon.
--focus <area> - — no subagent fan-out; one sequential pass. Use on tiny targets or when debugging the prompt.
--single - — append the contents of
--extra <file>to the review brief (after the category list). Use to add org-specific vulnerability classes, compliance checks, or stack-specific patterns. Plain text; same shape as the category blocks below.<file> - — skip the Step 3b confidence pass (saves a round of subagents). Findings keep the scanner's self-reported confidence only.
--no-score
- (必填)——待扫描的目录,支持相对路径或绝对路径。
<target-dir> - ——仅扫描指定重点领域(可重复使用该参数),跳过侦察步骤。
--focus <area> - ——不生成子代理,仅执行单次顺序扫描。适用于小型目标或调试提示时使用。
--single - ——将
--extra <file>的内容追加到审查简报中(位于分类列表之后)。用于添加组织特定的漏洞类别、合规检查或技术栈特定的检测模式。仅支持纯文本格式,需与下方分类块格式一致。<file> - ——跳过第3b步的可信度验证环节(减少一轮子代理调用)。检测结果仅保留扫描器自行报告的可信度评分。
--no-score
Step 1 — Scope
步骤1——范围确定
- Resolve . If it doesn't exist or has no source files, stop with an error.
<target-dir> - Look for . If present, parse its section 3 "Entry points & trust boundaries" table and section 4 "Threats" table for focus areas and threat classes. This is the preferred scoping input.
<target-dir>/THREAT_MODEL.md - If no THREAT_MODEL.md and no : do a quick recon — list the source tree, read entry points and dispatch code, and propose 3-10 focus areas using the pattern
--focus. Same shape as<subsystem> (<function/file>) — <key operations>.harness/prompts/recon_prompt.py - If was given, use exactly those.
--focus
Tell the user the focus areas you'll scan and the source-file count before
fanning out.
- 解析。若目录不存在或无源代码文件,则终止并返回错误。
<target-dir> - 查找。若存在,则解析其第3节“入口点与信任边界”表格和第4节“威胁”表格,提取重点领域和威胁类别。这是首选的范围输入依据。
<target-dir>/THREAT_MODEL.md - 若不存在THREAT_MODEL.md且未指定:执行快速侦察——列出源代码树,读取入口点和调度代码,按照
--focus的格式,提出3-10个重点领域。格式与<子系统>(<功能/文件>)——<核心操作>一致。harness/prompts/recon_prompt.py - 若已指定,则严格使用这些指定领域。
--focus
在生成子代理之前,告知用户将扫描的重点领域以及源代码文件数量。
Step 2 — Fan out
步骤2——并行扫描
Unless , spawn one Task subagent per focus area in parallel.
Cap at 10 concurrent. Each subagent gets the review brief below with its
focus area filled in. On tiny targets (<15 source files), fall through to
automatically.
--single--single除非指定,否则为每个重点领域生成一个Task子代理并行执行。并发数上限为10。每个子代理将收到下方的审查简报,并填充对应的重点领域。对于小型目标(少于15个源代码文件),将自动启用模式。
--single--singleReview brief (per subagent)
子代理审查简报
You are conducting authorized static security review of source code. Your
focus area: **{focus_area}**. Other agents cover other areas; duplication
is wasted effort.
TARGET: {target_dir}
TRUST BOUNDARY: {from THREAT_MODEL.md section 3, or "untrusted input → process memory"}
TASK: read the source in your focus area and identify candidate
vulnerabilities. This is static review — do NOT build, run, or probe
anything. Reason from the code.
REPORTING BAR: report anything with a plausible exploit path. Skip style
concerns, best-practice gaps, and purely theoretical issues with no attack
story at all — but if you're unsure whether something is real, REPORT IT
with a low confidence score rather than dropping it. A downstream triage
step does the rigorous verification; your job is to not miss things.
WHAT TO LOOK FOR:
MEMORY SAFETY (C/C++ and unsafe/FFI blocks) — HIGH VALUE:
- heap-buffer-overflow / stack-buffer-overflow / global-buffer-overflow
- heap-use-after-free / double-free
- integer overflow feeding an allocation or index
- format-string bugs
- unbounded recursion or allocation driven by untrusted size fields
INJECTION & CODE EXECUTION — HIGH VALUE:
- SQL / command / LDAP / XPath / NoSQL / template injection
- path traversal in file operations
- unsafe deserialization (pickle, YAML, native), eval injection
- XSS (reflected, stored, DOM-based) — but see React/Angular note below
AUTH, CRYPTO, DATA — HIGH VALUE:
- authentication or authorization bypass, privilege escalation
- TOCTOU on a security check
- hardcoded secrets, weak crypto, broken cert validation
- sensitive data (secrets, PII) in logs or error responses
LOW VALUE — note briefly, keep looking:
- null-pointer deref at small fixed offsets with no attacker control
- assertion failures / clean error returns (correct handling, not a bug)
DO NOT REPORT (common false positives — skip even if technically present):
- volumetric DoS / rate-limiting / resource-exhaustion — BUT unbounded
recursion, algorithmic-complexity blowup, or ReDoS driven by untrusted
input ARE reportable
- memory-safety findings in memory-safe languages outside unsafe/FFI
- XSS in React/Angular/Vue unless via dangerouslySetInnerHTML,
bypassSecurityTrustHtml, v-html, or equivalent raw-HTML escape hatch
- findings in test files, fixtures, build scripts, docs, or .ipynb
- missing hardening / best-practice gaps with no concrete exploit
- env vars and CLI flags as the attack vector (operator-controlled)
- regex injection, log spoofing, open redirect, missing audit logs
- outdated third-party dependency versions
{if --extra <file> was given: append its contents here verbatim}
For each finding you DO report, trace: where does the untrusted input
enter, what path reaches the sink, and what condition triggers it.
OUTPUT — one block per finding, nothing else:
<finding>
<id>F-{focus_idx:02d}-{n:02d}</id>
<file>{relative/path}</file>
<line>{line_number}</line>
<category>{heap-buffer-overflow | use-after-free | integer-overflow | sql-injection | command-injection | path-traversal | deserialization | xss | auth-bypass | hardcoded-secret | ...}</category>
<severity>{HIGH | MEDIUM | LOW}</severity>
<confidence>{0.0-1.0}</confidence>
<title>{one line}</title>
<description>{root cause, attacker control, trigger condition, data flow from entry to sink. Cite line numbers.}</description>
<exploit_scenario>{concrete attack: what input, from where, causing what outcome}</exploit_scenario>
<recommendation>{specific fix: parameterize the query, bounds-check before memcpy, etc.}</recommendation>
</finding>
SEVERITY: HIGH = directly exploitable → RCE, data breach, auth bypass.
MEDIUM = significant impact under specific conditions. LOW = defense-in-
depth.
If you find nothing reportable in your area after a thorough read, emit a
single <finding> with category=none and a one-line note of what you covered.You are conducting authorized static security review of source code. Your
focus area: **{focus_area}**. Other agents cover other areas; duplication
is wasted effort.
TARGET: {target_dir}
TRUST BOUNDARY: {from THREAT_MODEL.md section 3, or "untrusted input → process memory"}
TASK: read the source in your focus area and identify candidate
vulnerabilities. This is static review — do NOT build, run, or probe
anything. Reason from the code.
REPORTING BAR: report anything with a plausible exploit path. Skip style
concerns, best-practice gaps, and purely theoretical issues with no attack
story at all — but if you're unsure whether something is real, REPORT IT
with a low confidence score rather than dropping it. A downstream triage
step does the rigorous verification; your job is to not miss things.
WHAT TO LOOK FOR:
MEMORY SAFETY (C/C++ and unsafe/FFI blocks) — HIGH VALUE:
- heap-buffer-overflow / stack-buffer-overflow / global-buffer-overflow
- heap-use-after-free / double-free
- integer overflow feeding an allocation or index
- format-string bugs
- unbounded recursion or allocation driven by untrusted size fields
INJECTION & CODE EXECUTION — HIGH VALUE:
- SQL / command / LDAP / XPath / NoSQL / template injection
- path traversal in file operations
- unsafe deserialization (pickle, YAML, native), eval injection
- XSS (reflected, stored, DOM-based) — but see React/Angular note below
AUTH, CRYPTO, DATA — HIGH VALUE:
- authentication or authorization bypass, privilege escalation
- TOCTOU on a security check
- hardcoded secrets, weak crypto, broken cert validation
- sensitive data (secrets, PII) in logs or error responses
LOW VALUE — note briefly, keep looking:
- null-pointer deref at small fixed offsets with no attacker control
- assertion failures / clean error returns (correct handling, not a bug)
DO NOT REPORT (common false positives — skip even if technically present):
- volumetric DoS / rate-limiting / resource-exhaustion — BUT unbounded
recursion, algorithmic-complexity blowup, or ReDoS driven by untrusted
input ARE reportable
- memory-safety findings in memory-safe languages outside unsafe/FFI
- XSS in React/Angular/Vue unless via dangerouslySetInnerHTML,
bypassSecurityTrustHtml, v-html, or equivalent raw-HTML escape hatch
- findings in test files, fixtures, build scripts, docs, or .ipynb
- missing hardening / best-practice gaps with no concrete exploit
- env vars and CLI flags as the attack vector (operator-controlled)
- regex injection, log spoofing, open redirect, missing audit logs
- outdated third-party dependency versions
{if --extra <file> was given: append its contents here verbatim}
For each finding you DO report, trace: where does the untrusted input
enter, what path reaches the sink, and what condition triggers it.
OUTPUT — one block per finding, nothing else:
<finding>
<id>F-{focus_idx:02d}-{n:02d}</id>
<file>{relative/path}</file>
<line>{line_number}</line>
<category>{heap-buffer-overflow | use-after-free | integer-overflow | sql-injection | command-injection | path-traversal | deserialization | xss | auth-bypass | hardcoded-secret | ...}</category>
<severity>{HIGH | MEDIUM | LOW}</severity>
<confidence>{0.0-1.0}</confidence>
<title>{one line}</title>
<description>{root cause, attacker control, trigger condition, data flow from entry to sink. Cite line numbers.}</description>
<exploit_scenario>{concrete attack: what input, from where, causing what outcome}</exploit_scenario>
<recommendation>{specific fix: parameterize the query, bounds-check before memcpy, etc.}</recommendation>
</finding>
SEVERITY: HIGH = directly exploitable → RCE, data breach, auth bypass.
MEDIUM = significant impact under specific conditions. LOW = defense-in-
depth.
If you find nothing reportable in your area after a thorough read, emit a
single <finding> with category=none and a one-line note of what you covered.Step 3 — Collate
步骤3——结果整理
- Collect blocks from all subagents. Drop
<finding>placeholders.category=none - Light dedupe — if two findings cite the same with the same category, keep the one with the longer description and note the duplicate id. (Heavy dedupe is
file:line's job; don't over-engineer here.)/triage - Assign stable ids ,
F-001, ... in (severity desc, file, line) order.F-002
- 收集所有子代理返回的块。移除
<finding>的占位项。category=none - 轻度去重——若两个检测结果引用相同的且类别相同,则保留描述更详细的那一个,并标注重复ID。(深度去重是/triage工具的职责,此处无需过度设计。)
file:line - 按照(严重程度降序、文件路径、行号)的顺序,分配稳定的ID:、
F-001……F-002
Step 3b — Confidence pass (skip if --no-score
)
--no-score步骤3b——可信度验证环节(若指定--no-score
则跳过)
--no-scoreA cheap second-opinion read that ranks findings by signal quality.
Nothing is dropped — this pass calibrates so humans and
see high-signal findings first. Spawn one Task subagent per
finding in parallel with the brief below. Shallow: re-read and score, not
a full reachability trace.
confidence/triage这是一次低成本的二次审核,用于按信号质量排序检测结果。不会丢弃任何结果——此环节仅校准值,以便人工和/triage工具优先查看高信号结果。为每个检测结果并行生成一个Task子代理,并使用下方的简报。仅进行浅层审核:重新读取并评分,不进行完整的可达性追踪。
confidenceScoring brief (per finding)
评分简报(每个检测结果)
You are giving ONE candidate security finding an independent confidence
score. You are NOT deciding whether to keep it — every finding is kept.
You are deciding how likely it is to survive rigorous triage.
FINDING:
{the full <finding> block}
TARGET: {target_dir} (you may Read/Grep inside it; do NOT execute)
STEP 1 — Re-read the cited code. Open {file} around line {line}. Does the
code actually do what the description claims?
STEP 2 — Check against common false-positive patterns (volumetric DoS,
memory-safe language, test/fixture/doc file, framework auto-escape, env-var
vector, missing-hardening-only, regex/log injection, outdated dep). A match
lowers confidence sharply but does not auto-zero it.
STEP 3 — Score 1-10 that this is a real, actionable vulnerability:
1-3 likely false positive or noise
4-5 plausible but speculative
6-7 credible, needs investigation
8-10 high confidence, clear pattern
OUTPUT (exactly this, nothing else):
CONFIDENCE: <1-10>
REASON: <one line>Resolve: overwrite each finding's with the score
(normalized to 0.0-1.0) and attach . Re-sort findings
by ( desc, desc, , ) and reassign ids
in that order. Compute = findings with
confidence < 0.4, for the summary line.
confidenceconfidence_reasonconfidenceseverityfilelineF-001..low_confidence_countYou are giving ONE candidate security finding an independent confidence
score. You are NOT deciding whether to keep it — every finding is kept.
You are deciding how likely it is to survive rigorous triage.
FINDING:
{the full <finding> block}
TARGET: {target_dir} (you may Read/Grep inside it; do NOT execute)
STEP 1 — Re-read the cited code. Open {file} around line {line}. Does the
code actually do what the description claims?
STEP 2 — Check against common false-positive patterns (volumetric DoS,
memory-safe language, test/fixture/doc file, framework auto-escape, env-var
vector, missing-hardening-only, regex/log injection, outdated dep). A match
lowers confidence sharply but does not auto-zero it.
STEP 3 — Score 1-10 that this is a real, actionable vulnerability:
1-3 likely false positive or noise
4-5 plausible but speculative
6-7 credible, needs investigation
8-10 high confidence, clear pattern
OUTPUT (exactly this, nothing else):
CONFIDENCE: <1-10>
REASON: <one line>结果处理:将每个检测结果的值替换为归一化到0.0-1.0的评分,并附加字段。按照(可信度降序、严重程度降序、文件路径、行号)重新排序检测结果,并重新分配ID。计算=可信度<0.4的检测结果数量,用于摘要行。
confidenceconfidence_reasonF-001..low_confidence_countStep 4 — Write output
步骤4——生成输出文件
Write both files to :
<target-dir>/VULN-FINDINGS.json/triagejson
{
"target": "<target-dir>",
"scanned_at": "<iso8601>",
"focus_areas": ["..."],
"findings": [
{
"id": "F-001",
"file": "relative/path.c",
"line": 123,
"category": "heap-buffer-overflow",
"severity": "HIGH",
"confidence": 0.9,
"title": "...",
"description": "...",
"exploit_scenario": "...",
"recommendation": "...",
"confidence_reason": "..."
}
],
"summary": {"total": 0, "high": 0, "medium": 0, "low": 0, "low_confidence": 0}
}Findings are sorted by desc (then severity, file, line), so
the top of the file is the highest-signal material.
confidenceVULN-FINDINGS.md### F-NNN将两个文件写入:
<target-dir>/VULN-FINDINGS.jsonjson
{
"target": "<target-dir>",
"scanned_at": "<iso8601>",
"focus_areas": ["..."],
"findings": [
{
"id": "F-001",
"file": "relative/path.c",
"line": 123,
"category": "heap-buffer-overflow",
"severity": "HIGH",
"confidence": 0.9,
"title": "...",
"description": "...",
"exploit_scenario": "...",
"recommendation": "...",
"confidence_reason": "..."
}
],
"summary": {"total": 0, "high": 0, "medium": 0, "low": 0, "low_confidence": 0}
}检测结果按降序(然后是严重程度、文件路径、行号)排序,因此文件顶部为最高信号的内容。
confidenceVULN-FINDINGS.md### F-NNNStep 5 — Hand back
步骤5——结果交付
Tell the user:
- Counts: N findings (H/M/L split, X low-confidence), across K focus areas, from M source files.
- Top 3 by confidence, one line each.
- Next step:
> /triage <target-dir>/VULN-FINDINGS.json --repo <target-dir> - Remind: these are static candidates, not verified. For
execution-verified crashes, (README Step 2).
vuln-pipeline run <target>
告知用户:
- 统计信息:共N个检测结果(高/中/低严重程度分布,X个低可信度结果),覆盖K个重点领域,来自M个源代码文件。
- 可信度排名前三的检测结果,各用一句话描述。
- 下一步操作:
> /triage <target-dir>/VULN-FINDINGS.json --repo <target-dir> - 提醒:这些是静态候选结果,未经过验证。如需执行验证的崩溃测试,请使用(README第2步)。
vuln-pipeline run <target>
Constraints
约束条件
- Never execute target code. No Bash, no builds, no , no network. If the user asks you to "reproduce" or "confirm with a PoC," decline and point at
docker.vuln-pipeline - Don't fabricate line numbers. Every you emit must be something you Read or Grep'd. If unsure of the exact line, cite the function and say so in the description.
file:line - Stay in . Don't follow symlinks or
<target-dir>out of it... - Findings are candidates for , not final verdicts. This skill never drops a finding — Step 3b only ranks.
/triagedoes the rigorous N-vote verification and is where false positives actually get removed./triage
- 绝不要执行目标代码。禁止使用Bash、构建、或网络请求。若用户要求“复现”或“用PoC验证”,请拒绝并引导至
docker。vuln-pipeline - 不要伪造行号。所有输出的必须是你已读取或Grep过的内容。若不确定确切行号,请引用函数名并在描述中说明。
file:line - 仅在内操作。请勿跟随符号链接或通过
<target-dir>跳出目标目录。.. - 检测结果是/triage工具的候选项,而非最终结论。本技能绝不丢弃任何检测结果——第3b步仅进行排序。/triage工具会执行严格的多轮验证,真正移除误报。
Provenance
来源说明
The focus-area recon pattern and memory-safety quality tiers are lifted
from this repo's own and
— the same logic the autonomous pipeline
uses, applied statically. The broader category menu, DO-NOT-REPORT
exclusions, per-finding confidence pass, and
/ output fields are adapted from
's
command.
harness/prompts/find_prompt.pyharness/prompts/recon_prompt.pyexploit_scenariorecommendationanthropics/claude-code-security-review/security-review重点领域侦察模式和内存安全质量分级来自本仓库的和——与自动流水线使用的逻辑相同,此处应用于静态扫描。更广泛的类别菜单、禁止报告的排除项、每个检测结果的可信度验证环节,以及/输出字段,均改编自的命令。
harness/prompts/find_prompt.pyharness/prompts/recon_prompt.pyexploit_scenariorecommendationanthropics/claude-code-security-review/security-review