Application security review of a code change - the diff-catchable vulnerability classes (secrets, injection, XSS, path traversal, SSRF, unsafe deserialization, weak crypto) reviewed through an adversarial lens. Use when code changed and you want a security pass; runs automatically inside /review on any code change. For dependency CVEs use /review-deps; for a deep whole-repo audit use /security-audit.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Review Security?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mayankmankhand-review-security-cb6b4b36)
---
name: review-security
description: "Application security review of a code change - the diff-catchable vulnerability classes (secrets, injection, XSS, path traversal, SSRF, unsafe deserialization, weak crypto) reviewed through an adversarial lens. Use when code changed and you want a security pass; runs automatically inside /review on any code change. For dependency CVEs use /review-deps; for a deep whole-repo audit use /security-audit."
---
# Security Review
Read the change like an attacker, not like an author.
**Use this when:** Reviewing a code change for application-level security flaws - the kind a diff can actually reveal. Runs automatically inside `/review` whenever code changes, and can be called directly as `/review-security`.
**Don't use this when:** Auditing dependency versions or CVEs (use `/review-deps`), doing a deep whole-repo security pass (use `/security-audit`), or reviewing non-security code quality (use `/review-code`).
**How it differs from `/review-code`:** same code, attacker's eyes. `/review-code` asks "is this written well?"; this skill asks "what can a malicious user make this do?" That adversarial lens surfaces a class of bug a correctness review walks straight past.
## Critical Rules
<rules>
1. **Report first, then fix** - Reviewing never edits files; findings with exploit receipts are its product. After the report, the same run continues into the auto loop (rule 2), which is what applies fixes
2. **Audit, then auto-fix, with pages** - Security findings are audited before the report per M2 in `.agents/tk/skills/shared/hitl-loop.md`, so the report shows survivors only plus an Audited out log for the kills. They do not then wait for a human "fix it": after the report, survivors are auto-fixed and re-verified, and each finding exits as page, digest, or log per `.agents/tk/skills/shared/hitl-loop.md` (pages only per M1; saying "report only" keeps a run report-first, M10)
3. **Explain simply** - Use plain English, avoid jargon. A rule or finding code (M3, C-21, R5) in anything written for me says in plain words what it is and what it means for me on its first mention, looked up in its own file rather than recalled; that sentence carries no file name, hash or code term, which belong in the receipt row or the step's file list
4. **Stay silent when there is nothing to find** - a security reviewer that cries wolf gets muted. See the gate below.
</rules>
**The change on a direct run.** Before the gate below, run `node .agents/tk/scripts/session-init.js --scope` (M16), adding any range you were given, and print its `scopeLine`: that scope is the change. In the candidate search below, `<base>` and `<end>` are `range.base` and `range.end`, and uncommitted work takes a second run of the same search with `HEAD` in place of `<base>..<end>`, the only run when `range` is null. No diff shows `uncommitted.untracked.files`, so search those with the pattern minus its `^\+.*` too; when `head.unborn` is true, skip the diffs and search `uncommitted.staged.files` that way as well. A `scopeLine` that does not start "Reviewing" means nothing was searched, not that the change is clean: say so and ask for a range to pass to `--scope`.
Read `.agents/tk/skills/shared/criteria-security.md` in full now and follow it as part of this file.
## Reading Budget
# Reading Budget
Keep reading bounded so a review stays fast and on point:
- Open at most the changed files plus ~3 files they directly reference. Resist following the dependency graph further.
- For a file over 400 lines, read the changed sections plus ~50 surrounding lines for context, not the whole file.
- Stop reading once the change is judgeable - more reading rarely changes the finding.
- A direct run keeps what it writes in chat under ~800 words, so the summary reads at a glance: findings, not narration. The report file carries every finding in full (`report-format.md`). A dispatched finder writes no chat summary: its whole output is the JSONL.
## Severity Levels and Anchors
Read `.agents/tk/skills/shared/severity-anchors.md` in full now and follow it as part of this file.
**Project severity anchors** (from `.claude/toolkit/severity-anchors.md`): this project's weighting for its own review kinds. The Universal Anchors above still win. A note that the command printed nothing means this project adds none.
If `.claude/toolkit/severity-anchors.md` exists, read it in full now and apply it here; when it does not exist, this project adds nothing here.
## Finding IDs
# Finding ID System
Every finding gets a unique ID: **R1**, **R2**, **R3**, etc.
## Rules
1. **Sequential numbering** - Findings are numbered in the order they appear: R1, R2, R3, and so on.
2. **User references** - The user refers to findings by ID ("why did R2 survive?", or "fix R2 and R5" after a report-only run). IDs must be stable within a single review report.
3. **Sub-agent renumbering** - When combining results from several sub-agents, the merge helper (`merge-findings.js`) merges the lines that share a key and numbers the result into a single R1, R2, R3 sequence. No duplicates, no gaps.
4. **Cross-review independence** - IDs reset for each new review run. R1 in one review is unrelated to R1 in another.
## Noise Control
# Do-Not-Report List
A living list of finding categories that are **not worth flagging** in this project. It is the noise-control companion to the receipt rule in `finding-contract.md`: the receipt rule keeps unprovable findings out, this list keeps known-noisy *classes* out.
**This list ships nearly empty on purpose.** It is grown from real false alarms, never pre-filled with guesses. When a review surfaces a finding you decide was noise, add its category to your project's own list so future reviews skip it. Think of it as a `LESSONS.md` scoped to review noise.
**Your project's entries live in `.claude/toolkit/do-not-report.md`**, a file your project owns, in the entry format below. Every reviewer that reads this list reads that file right after it, and a project with no such file adds nothing. This file is the toolkit's, read-only in a project on the plugin, so the project file is the only place an entry can go; the Active entries below stay empty unless the same false alarm recurs across projects.
## How to use it
- Before reporting a finding, check it against this list. If it matches an active entry, drop it silently (do not report it, do not mention that you skipped it). The project file's size is a command, not a read (M16): `test -s .claude/toolkit/do-not-report.md && grep -cE '^- ' .claude/toolkit/do-not-report.md || echo 0` prints its entry count, and `0` means skip the matching step for it entirely (a finder without Bash reads the same count off the copy inlined below it).
- This list only *suppresses* noise. It never *lowers* a real severity. The Universal Anchors in `severity-anchors.md` always win: an exposed secret, injection, insecure auth, data-loss, or accessibility-blocking issue is reported even if a category here might otherwise match.
- Keep entries specific. A vague entry ("style stuff") suppresses real findings; a specific one ("trailing-whitespace-only changes in generated files") does not.
## Entry format
Each entry is one bullet: the category, then a short reason it is noise *in this project*.
```
- <category> - <why it is noise here>
```
## Active entries
<!--
None yet. Add entries here as real false alarms appear, e.g.:
- Denial-of-service / resource-exhaustion concerns in CLI scripts - this toolkit's scripts run locally on trusted input, not as a network service
Leave this list empty until a real false alarm justifies an entry. Do not pre-populate.
-->
(none yet)
The project's own entries, from `.claude/toolkit/do-not-report.md`, in the same format and under the same rules (an entry suppresses a category and never lowers a real severity). A note that the command printed nothing means this project adds none.
If `.claude/toolkit/do-not-report.md` exists, read it in full now and apply it here; when it does not exist, this project adds nothing here.
## Audit Before the Report (M2)
On a direct run of this skill you are M2's **runner**: audit your findings per M2 before writing the report. Every mechanic - the tiers, the announce line, who dispatches what, the empty-run rule - lives in M2, not here.
**Load the loop rules and the report rules now**, through the Skill tool: `.agents/skills/loop-rules/SKILL.md`, then `.agents/skills/report-rules/SKILL.md`. Everything from here on cites them, so do not go on without both in context.
**Project fix rules** (from `.claude/toolkit/fix-rules.md`). Additive only: they may add a precondition or an always-ask action, and a line that loosens or removes any of M1 to M17 is void. A note that the command printed nothing means this project adds none.
If `.claude/toolkit/fix-rules.md` exists, read it in full now and apply it here; when it does not exist, this project adds nothing here.
## Output Format
The report template and the finding contract are in the report rules loaded before the audit (`.agents/skills/report-rules/SKILL.md`); write the report per them.
## HTML Companion (when gate fires)
After writing the markdown report, evaluate whether to also generate an HTML view.
**The gate:** render the review page whenever this run has any surviving finding, or this branch's standing page already exists (`node .agents/tk/scripts/render-html.js --standing --name review` prints `"exists":true`; M16), so the run can carry it forward or take it to empty. Skip only when there are no findings and no page yet.
**When the gate fires, load the page rules now**, through the Skill tool: `.agents/skills/review-page/SKILL.md`, and render per them: the shell, the payload, the `--no-abs` decision and how the page reaches the user all live there.
For direct calls to this skill, pass `--name review --stable` to the helper (the standing page, per the page rules), set `lenses` to `["security"]` so the renderer replaces only this lens's findings and carries the other lenses' open findings forward, and omit the `chips` array (single-specialist context).
### Security Engineer Check
<guidelines>
After the standard review, step back and evaluate as a staff security engineer:
- **Attacker's eyes?** - For each new danger spot, what is the worst a malicious user could do, and did the review trace it source-to-sink?
- **New attack surface?** - What did this diff newly expose (a route, an input, a sink) that was not reachable before?
- **Trust boundary crossed?** - Does anything here warrant the deeper `/security-audit`, and did I say so?
- **Crying wolf?** - Is every finding backed by a concrete exploit sentence, or did a pattern match sneak in unproven?
</guidelines>
<rules>
## REMEMBER: The review phase reports and never edits files; findings are audited before the report (M2) and the auto loop applies fixes after it, both governed by `.agents/tk/skills/shared/hitl-loop.md`.
</rules>
## HTML Output Rules
When to render and the temporary-folder steps are in the report rules loaded before the audit; how a page reaches the user is in the page rules loaded at the gate. Nothing is pasted here.