viper-diff-pr-review
Skill22 starsChanged 15 days agoMITView on GitHub
Differential Pull Request & Commit Security Review Auditor (modeled on Trail of Bits differential-review). Audits changed hunks for auth regressions, new sinks, and dependency drift.
In this repository72 other files it gives its agents.
- llms.txtllms.txt
- viper-agent-skill-supplychainSkill
- viper-ai-llm-guardrailsSkill
- viper-api-gateway-apigee-kongSkill
- viper-auth-oauth-jwtSkill
- viper-aws-iam-cloud-auditSkill
- viper-bola-idorSkill
- viper-browser-extension-mv3Skill
- viper-browseros-agentSkill
- viper-cicd-hardeningSkill
- viperclawSkill
- viper-container-k8s-auditSkill
- viper-crypto-tls-auditSkill
- viper-csrf-samesite-auditSkill
- viper-dependency-sbomSkill
- viper-deserialization-parserSkill
- viper-dns-email-domainSkill
- viper-electron-tauri-desktopSkill
- viper-fastapi-django-flaskSkill
- viper-file-upload-storageSkill
- viper-gcp-azure-cloud-auditSkill
- viper-github-repo-governanceSkill
- viper-go-service-auditSkill
- viper-graphql-wsSkill
- viper-grpc-protobuf-auditSkill
- viper-headers-csp-corsSkill
- viper-iac-terraform-auditSkill
- viper-incident-forensics-triageSkill
- viper-injection-oracleSkill
- viper-java-spring-auditSkill
- viper-js-harvesterSkill
- viper-kafka-rabbitmq-queueSkill
- viper-linux-systemd-hostSkill
- viper-logging-pii-complianceSkill
- viper-mcp-server-auditSkill
- viper-mobile-api-configSkill
- viper-multitenant-isolationSkill
- viper-nextjs-react-rscSkill
- viper-nginx-envoy-gatewaySkill
- viper-nodejs-express-nestjsSkill
- viper-oauth-oidc-complianceSkill
- viper-openapi-rest-schemaSkill
- viper-orchestratorSkill
- viper-payment-stripe-pciSkill
- viper-php-laravel-wordpressSkill
- viper-postgres-redis-mongoSkill
- viper-privacy-gdpr-hipaaSkill
- viper-proof-judgeSkill
- viper-proxy-fingerprintSkill
- viper-proxy-parser-alignmentSkill
- viper-race-logicSkill
- viper-rag-vector-auditSkill
- viper-rate-limit-dos-resilienceSkill
- viper-remediation-patch-verifierSkill
- viper-ruby-rails-auditSkill
- viper-rust-memory-unsafeSkill
- viper-saml-sso-enterpriseSkill
- viper-sbom-slsa-provenanceSkill
- viper-secrets-auditSkill
- viper-semgrep-rule-authorSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 62
Verify whether a global router middleware enforces the control removed at the handler level.
- Very specific: line 91
Run viperclaw taint ., viperclaw secrets ., and viperclaw iac .
- Distinctive: line 92
Add a negative regression test covering every modified authorization boundary.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Differential PR & Commit Security Review Auditor (viper-diff-pr-review)
1. Executive Scope, Standards & CWE/OWASP Mapping
- Frameworks & Standards: OWASP SAMM Verification, NIST SSDF (PW.7 Code Review), CWE-284, CWE-862
- Primary CWE Mapping: CWE-862 (Missing Authorization Introduced in Diff), CWE-20 (Unvalidated New Input), CWE-798 (Newly Added Secret)
- ViperClaw MCP Tools:
viper_taint_scan,viper_secrets_scan,viper_iac_audit,viper_sbom_deps,viper_verify_and_report - ViperClaw CLI Command:
git diff origin/main...HEAD && viperclaw taint . && viperclaw secrets .
2. Threat Model & Root-Cause Architecture
flowchart LR
Diff["PR Git Diff (Changed Hunks)"] --> Auth["Auth / Middleware Removal Check"] --> Sinks["New Taint & Secret Sinks"] --> Deps["Lockfile & CI Workflow Delta"]Root-Cause Analysis
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.
3. Deterministic Discovery & Grep/AST Audit Commands
# 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 .4. Senior Security Engineer 8-Point Audit Checklist
| 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. |
5. False-Positive Elimination & CVSS v3.1 Triage Rubric
False-Positive Gate
- Confirm the changed hunk is reachable in production code (not test-only fixtures or docs).
- Verify whether a global router middleware enforces the control removed at the handler level.
| 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. |
6. Production Remediation Patterns (Vulnerable vs. Hardened Code)
# ❌ 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()
)7. Regression Testing & Continuous Verification
- Run
viperclaw taint .,viperclaw secrets ., andviperclaw iac .on the PR branch. - Add a negative regression test covering every modified authorization boundary.
- Export verified findings via
viper_verify_and_reportas SARIF 2.1.0 for PR code scanning.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

