/viperclaw:viper-diff-pr-reviewfrom viperclaw
Audits PR diffs and commits for security regressions: removed auth guards, new taint sinks, hardcoded secrets, and dependency drift. Modeled on Trail of Bits differential-review methodology.
Ships in viperclaw. 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.
viper-diff-pr-review)viper_taint_scan, viper_secrets_scan, viper_iac_audit, viper_sbom_deps, viper_verify_and_reportgit diff origin/main...HEAD && viperclaw taint . && viperclaw secrets .flowchart LR
Diff["PR Git Diff (Changed Hunks)"] --> Auth["Auth / Middleware Removal Check"] --> Sinks["New Taint & Secret Sinks"] --> Deps["Lockfile & CI Workflow Delta"]
Production security regressions frequently enter through small pull requests that remove an authentication decorator, relax a route middleware group, add a raw query helper, or introduce an unpinned dependency without triggering full-repo reviews.
# 1. Inspect changed files and security-sensitive hunks
git diff --stat origin/main...HEAD
git diff -U3 origin/main...HEAD | rg -n "(auth|permission|role|tenant|sql|exec|secret|cors|csrf|redirect)"
# 2. Run ViperClaw static gates on the working tree
viperclaw taint . --db .viperclaw/graph.db
viperclaw secrets .
viperclaw iac .
| Control ID | Audit Verification Target | Pass Criteria | Fail / Vulnerability Indicator |
|---|---|---|---|
DIFF-01 | No Removed Auth / RBAC Guards | Deleted lines do not drop @login_required, @PreAuthorize, Depends(get_current_user), or tenant filters. | Middleware or route guard removed during refactoring. |
DIFF-02 | New Endpoints Have Input DTOs | Every newly added route binds inputs to strict allowlisted schemas (extra="forbid" / whitelist: true). | New controller reads raw req.body or request.json directly into ORM models. |
DIFF-03 | Zero New Hardcoded Secrets | viper_secrets_scan returns 0 new credential findings across added lines. | API key, private key, or test credential committed in config or fixtures. |
DIFF-04 | Parameterized New Queries & Commands | All newly introduced DB, template, or subprocess calls use parameterized bindings. | String interpolation (f"SELECT ... {x}") introduced in new helper function. |
DIFF-05 | Dependency & Lockfile Integrity | New packages in package.json/requirements.txt/go.mod are pinned and reflected in lockfiles. | Unpinned dependency or new postinstall script added without review. |
DIFF-06 | CI/CD & IaC Delta Safety | Changes to .github/workflows/, Dockerfile, or *.tf preserve least-privilege permissions. | PR adds pull_request_target or widens IAM/security-group rules. |
DIFF-07 | Error & Logging Hygiene | Newly added catch/except blocks do not log tokens, cookies, or raw request bodies. | Debug log prints Authorization header or user password. |
DIFF-08 | Regression Test Coverage | Security-sensitive diffs include both positive and negative authorization unit tests. | Auth change merged without negative unit test proving unauthorized callers receive 401/403. |
| Severity Tier | Baseline CVSS v3.1 Vector | Qualifying Security Impact |
|---|---|---|
| CRITICAL (9.1) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N | PR removes authentication or tenant scoping on a production data/admin endpoint. |
| HIGH (7.5) | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N | PR introduces unparameterized SQL/command sink or commits a live production secret. |
| MEDIUM (5.3) | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N | PR relaxes CORS/CSP headers or introduces unpinned CI/dependency configuration. |
# ❌ VULNERABLE DIFF: Refactoring drops tenant_id check from query
def get_invoice(invoice_id: str, user: User):
return db.query(Invoice).filter(Invoice.id == invoice_id).first()
# ✅ HARDENED DIFF: Preserves tenant_id isolation and verifies ownership
def get_invoice(invoice_id: str, user: User):
return (
db.query(Invoice)
.filter(Invoice.id == invoice_id, Invoice.tenant_id == user.tenant_id)
.first()
)
viperclaw taint ., viperclaw secrets ., and viperclaw iac . on the PR branch.viper_verify_and_report as SARIF 2.1.0 for PR code scanning.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub zahidoverflow/viperclaw --plugin viperclaw72 skills in this plugin
/viper-agent-skill-supplychainAI Agent Skill, Plugin & MCP Config Supply-Chain Auditor (modeled on NVIDIA SkillSpector & OWASP Agentic Skills Top 10). Audits SKILL.md bundles and MCP JSON configs./viper-ai-llm-guardrailsAI, LLM & MCP Application Security & Guardrails Auditor (OWASP LLM Top 10). Reviews prompt boundaries, RAG data isolation, tool-call authorization, and output sanitization./viper-api-gateway-apigee-kongAPI Gateway, BFF & Rate-Tier Policy Auditor (Kong, AWS API Gateway, Apigee, Envoy Gateway). Reviews JWT authorizers, backend origin lockdown, and route-level quotas.Other plugins' skills for the same job