/secskills-core:reviewing-code-changesfrom secskills-core
Security reviews a diff, branch, or pull request with a triage-first workflow and false-positive discipline. Assesses what a change introduces, weakens, or exposes before merge or commit.
Ships in secskills-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Reviewing a diff is not auditing a codebase in miniature. The diff shows you what changed but hides what the change means — the caller that now receives untrusted data, the check that used to run, the assumption that no longer holds. Reviewing only the added lines is the standard way to miss the bug.
auditing-code-for-vulnerabilitiesauditing-supply-chain# Against the actual merge base, not against whatever HEAD happens to be
BASE=$(git merge-base HEAD origin/main)
git diff --stat $BASE...HEAD
git diff $BASE...HEAD
# Rename and whitespace noise hides real changes
git diff -M -C -w $BASE...HEAD
# Files changed most, and by whom — where to spend attention
git diff --numstat $BASE...HEAD | sort -rn | head -20
Three things to establish before reading code:
Not all diffs deserve equal time. Rank hunks by what they touch:
| Priority | Signals |
|---|---|
| Critical | Auth/authz logic, session handling, crypto, input parsing on an untrusted boundary, SQL/command/template construction, file path handling, deserialization, CI/CD workflows, IAM/security-group config, dependency additions |
| High | New endpoints or routes, new tool/RPC surface, error handling on security paths, logging of user data, tenant scoping, cache keys, rate limits |
| Medium | Business logic that consumes validated input, refactors that move security-relevant code |
| Low | Tests, docs, formatting, comments — but read test deletions |
# Fast triage of a large diff
git diff $BASE...HEAD --name-only | rg 'auth|login|session|crypto|password|token|admin|permission|\.github/workflows|Dockerfile|terraform|policy'
git diff $BASE...HEAD -U10 | rg -n '^\+.*(eval\(|exec\(|system\(|innerHTML|pickle|yaml\.load|Sprintf.*SELECT|shell=True|verify=False|InsecureSkipVerify)'
The most dangerous diffs delete things. Search the removed lines specifically:
git diff $BASE...HEAD | rg '^-' | rg -i 'auth|verify|valid|check|sanitiz|escape|permission|assert|csrf|limit'
TODO: add authz that was never done and is now shippingstrict mode, a security header, or a CSP directive relaxedApply the bug-class hunting from auditing-code-for-vulnerabilities, but
scoped to the changed paths: injection sinks, authorization on new object
lookups, SSRF in new outbound calls, path handling on new file operations,
deserialization, secrets, weak randomness, unsafe defaults.
The two questions that catch most real issues in a diff:
Does new untrusted data reach an old sink? Does old untrusted data reach a new sink?
Both require reading outside the diff.
Read the whole function for every non-trivial hunk. Then check callers:
# Who calls the changed function, and do they still satisfy its assumptions?
rg -n 'changedFunctionName\s*\(' --type <lang>
# What else in the codebase uses the pattern this change introduced?
git log -1 --format=%H $BASE # anchor, then compare behaviour before/after
Specifically check whether the change alters an invariant that other code relies on: a function that used to sanitize and now does not, a return value whose meaning flipped, a nullable that became non-null, an ordering guarantee that was dropped.
git diff $BASE...HEAD -- '*.yml' '*.yaml' '*.tf' 'Dockerfile*' '.github/**' '*.json'
auditing-supply-chain.)pull_request_target added, unpinned actions"*"Machine-written diffs fail in characteristic ways: plausible-looking validation that does not actually constrain, error handling that swallows security-relevant failures, invented API usage that silently no-ops, and copied patterns applied where the surrounding assumptions differ. For a large generated diff, sample the security-relevant hunks and verify against the real library behaviour rather than reading for plausibility.
Diff review generates false positives faster than any other review mode, because the missing context is exactly what makes a hunk look wrong. Before raising a finding:
Then state the finding with a concrete failure scenario: the input, the path, and the result. "This could be unsafe" is not a review comment; it is a request for someone else to do the analysis.
Separate what blocks the merge from what does not:
## Security review — PR #482
**Blocking**
1. `api/reports.go:214` — export handler drops the tenant predicate present on
the list path. Any authenticated user can export another tenant's report by
ID. Add `AND tenant_id = ?` to the lookup.
**Non-blocking, should fix**
2. `api/reports.go:190` — report IDs are sequential, making enumeration
trivial once (1) is fixed. Consider opaque IDs.
**Notes / pre-existing**
3. The `findByID` pattern without scoping appears in 14 other handlers and
predates this PR. Filed as ISSUE-991 rather than blocking here.
**Reviewed but clear**
- New `/webhooks/stripe` route: signature verified before body parse, replay
window enforced. No finding.
- Dependency bump `lodash 4.17.20 → 4.17.21`: patch for CVE-2021-23337, no
API change.
**Not covered**
- The React changes under `web/` were not reviewed for XSS in depth; the diff
touches 40 components.
Stating what you reviewed and found clean is as useful as the findings — it tells the next reviewer where not to spend time, and it makes the coverage of the review honest.
auditing-code-for-vulnerabilities — full audit methodology and bug classesauditing-supply-chain — dependency and workflow changes in the diffsecuring-ai-systems — reviewing changes to LLM/agent featuresreporting-security-findings — severity and write-up when a finding leaves the PRWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub trilwu/secskills --plugin secskills-core30 skills in this plugin
/analyzing-binariesReverse engineer compiled binaries, firmware, and mobile app packages using triage, static disassembly, decompilation, and dynamic instrumentation. Use when analyzing an executable, ELF/PE/Mach-O file, firmware image, or stripped binary, recovering an algorithm or protocol, or working a CTF reversing challenge./analyzing-dotnet-assembliesReverse engineer .NET assemblies and executables with dnSpyEx, ILSpy, and de4dot — identifying and unwrapping obfuscators and packers, deobfuscating control flow and string encryption, handling single-file and NativeAOT publishes, and patching IL. Use when a binary is a managed PE, when ILSpy shows mangled names or empty method bodies, or when analyzing .NET malware, a loader, or a Windows application./analyzing-2 plugins ship this exact skill · first indexed Jul 31, 2026
Other plugins' skills for the same job