From d52673649fa0040a813b33a9fb4e73fa9e29b2b9 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi <3247106+gantoine@users.noreply.github.com> Date: Thu, 29 Oct 2026 13:08:55 -0400 Subject: [PATCH] chore: add reverted-fix, reach and test checks to security-audit (#5390) * chore: add reverted-fix, reach and test checks to security-audit Flag deleted lines that arrived in a security fix, count the callers of a changed symbol instead of guessing its reach, and treat untested sensitive changes as needs-attention. Rank findings by reach and coverage. Co-Authored-By: Claude Opus 5.5 * chore: address Greptile review on security-audit checks Run git log -S against the range tip, exclude backend tests from the caller grep and tell the reader to inspect matches rather than counting lines, and limit the test diff to actual frontend test files. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .claude/skills/security-audit/SKILL.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.claude/skills/security-audit/SKILL.md b/.claude/skills/security-audit/SKILL.md index 34684e298..108bd3eb7 100644 --- a/.claude/skills/security-audit/SKILL.md +++ b/.claude/skills/security-audit/SKILL.md @@ -88,6 +88,18 @@ git shortlog -sne $RANGE # distinct authors + count Every author should be a plausible contributor. author≠committer with committer `noreply@github.com` is normal (squash-merge/bot). An unknown human committer overriding another author's commit is not. +**Reverted fixes, reach, and tests** for each security-sensitive change (auth, scopes, ownership, file ops, validation): + +```bash +git log --oneline -S'' "${RANGE#*..}" -- # which commit added a line the range deletes +git grep -nw '' "${RANGE#*..}" -- backend frontend/src ':(exclude)backend/tests' # where it is referenced +git diff --name-only $RANGE -- backend/tests 'frontend/src/*.test.ts' 'frontend/src/*.spec.ts' # tests the range adds or changes +``` + +- A deleted check that arrived in a fix, security commit, or GHSA is a reintroduced bug until proven otherwise. +- Count callers rather than guessing: read the matches and drop definitions, imports and comments, then follow aliases. A weakened helper used by 40 endpoints outranks one used by a single route. +- Changed sensitive code with no test covering it (`backend//x.py` → `backend/tests//test_x.py`) is `needs attention`, not proof of malice. + --- ## 3. Fan out deep review @@ -106,7 +118,7 @@ Prompt each agent to: assume legit-until-proven, cite `file:line`, say concretel ## 4. Judge, then verdict -For each candidate finding, decide reachability before calling it: Is the input attacker-controlled or admin-config/DB-derived? Is the endpoint authed and scoped? Does the tainted value actually reach a sink? A scary-looking sink fed only by trusted server-side data is benign, say so. +For each candidate finding, decide reachability before calling it: Is the input attacker-controlled or admin-config/DB-derived? Is the endpoint authed and scoped? Does the tainted value actually reach a sink? A scary-looking sink fed only by trusted server-side data is benign, say so. Rank real findings by caller count and test coverage too: wide reach with no test is the most urgent. Deliver one consolidated verdict: