agentleFS
zahidoverflowzahidoverflow/viperclaw/skills/viper-dependency-sbom/SKILL.md

viper-dependency-sbom

Skill22 starsChanged 15 days agoMITView on GitHub

Software Supply Chain, Lockfile Integrity & Dependency Vulnerability Auditor (modeled on OSV-Scanner, Pip-Audit & Dependabot). Reviews manifests, lockfiles, and namespace confusion risks.

  • Installs packages

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run the following discovery commands across the target repository before manual code review:

    line 30
  2. Distinctive:

    Verify whether an upstream API Gateway, global middleware, or ORM hook already enforces the control before flagging a controller.

    line 62
  3. Distinctive:

    Write a Positive Unit Test confirming authorized, schema-valid requests succeed.

    line 86
  4. Distinctive:

    Write a Negative Security Regression Test confirming unauthorized, cross-tenant, or malformed inputs are deterministically rejected.

    line 87

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Software Supply Chain, Lockfile Integrity & Dependency Confusion Auditor (viper-dependency-sbom)

1. Executive Scope, Standards & CWE/OWASP Mapping

  • Frameworks & Standards: OWASP Top 10:2025 A03/A06 (Software Supply Chain Failures), SLSA v1.0, OSV Schema, CWE-1357, CWE-427
  • Primary CWE Mapping: CWE-1357 (Reliance on Insufficiently Trustworthy Component), CWE-427 (Uncontrolled Search Path / Dependency Confusion), CWE-829 (Inclusion of Functionality from Untrusted Control Sphere)
  • ViperClaw MCP Tools: viper_taint_scan, viper_verify_and_report
  • ViperClaw CLI Command: viperclaw taint . --db .viperclaw/graph.db

2. Threat Model & Root-Cause Architecture

flowchart LR
  Manifest["pyproject.toml / package.json / Cargo.toml"] --> Lock["Pinned Lockfile + SHA-256 Hashes"] --> Reg["Scoped Registry (.npmrc / --index-url)"] --> Build["Hermetic CI Build (--frozen-lockfile)"]

Root-Cause Analysis

Supply-chain compromises occur when builds use floating version ranges (^, ~, >=), mix public and private package indexes via pip --extra-index-url (allowing public PyPI/npm packages with higher version numbers to shadow internal package names), or run untrusted postinstall scripts.


3. Deterministic Discovery & Grep/AST Audit Commands

Run the following discovery commands across the target repository before manual code review:

# 1. Automated ViperClaw analysis
viperclaw taint . --db .viperclaw/graph.db

# 2. Rapid static pattern discovery (ripgrep)
rg -n "(extra-index-url|@.*:registry|publishConfig|replace\s+.*=>)"
rg -n "(postinstall|preinstall|install)\s*:" package.json
rg -n "(git\+https?://|http://)" pyproject.toml requirements*.txt package.json Cargo.toml

4. Senior Security Engineer 8-Point Audit Checklist

Control IDAudit Verification TargetPass CriteriaFail / Vulnerability Indicator
DEP-01Deterministic Lockfile EnforcementCI/CD and Docker builds enforce npm ci, pnpm install --frozen-lockfile, pip install --require-hashes, or cargo build --locked.Production builds run pip install -r requirements.txt or npm install with floating versions.
DEP-02Dependency Confusion Prevention (pip / npm)Never use pip --extra-index-url for private packages without explicit package pinning; bind @scope in .npmrc to private registry.--extra-index-url used with unclaimed internal package names on public PyPI.
DEP-03Unclaimed @scope & Internal Package AuditAll internal @org/pkg scopes in package.json, sourcemaps, or documentation are registered/owned on public npm/PyPI.Internal JS bundle leaks @company-internal/auth where @company-internal is unclaimed on npmjs.com.
DEP-04Install-Script Hardening (--ignore-scripts)Package installations disable arbitrary lifecycle hooks (ignore-scripts=true) or audit every preinstall/postinstall script.Untrusted transitive dependencies allowed to execute arbitrary shell scripts during npm install.
DEP-05Git Dependency Commit SHA PinningAny dependency sourced from Git (git+https://...) is pinned to an immutable 40-char commit SHA, not a mutable branch/tag."pkg": "github:owner/repo#main" used in package.json or requirements.txt.
DEP-06Reachable CVE & Abandoned Package TriageZero known Critical/High CVEs (OSV / GitHub Advisory) in reachable production dependencies.Outdated parsers/frameworks (PyYAML < 5.4, lodash < 4.17.21, log4j) in production lockfile.
DEP-07Typosquatting & Hallucinated Package CheckEvery newly added package name is verified against official repository URLs and download counts (blocking slopsquatting).AI-hallucinated or typosquatted package name added to manifest.
DEP-08Runtime vs. Dev Dependency SeparationTest runners, linters, and debug tools are placed in [project.optional-dependencies] / devDependencies and excluded from production images.Debug/test frameworks installed into the final production container image.

5. False-Positive Elimination & CVSS v3.1 Triage Rubric

False-Positive Gate

  1. Verify whether an upstream API Gateway, global middleware, or ORM hook already enforces the control before flagging a controller.
  2. Confirm the code path is reachable from an external entrypoint (not dead code, CLI-only admin script, or unit-test fixture).
Severity TierBaseline CVSS v3.1 VectorQualifying Security Impact
CRITICAL (9.8)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:HClaimable private package name exposed via --extra-index-url or unclaimed @scope (Dependency Confusion RCE).
HIGH (8.1)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NReachable High/Critical CVE in a direct or transitive runtime dependency.
MEDIUM (5.3)CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:NUnpinned floating dependencies in production build without lockfile integrity hashes.

6. Production Remediation Patterns (Vulnerable vs. Hardened Code)

# ❌ VULNERABLE: Uses --extra-index-url (Dependency Confusion) without lockfile hashes
RUN pip install --extra-index-url https://pypi.internal.example.com/simple -r requirements.txt

# ✅ HARDENED: Uses single trusted internal mirror (with upstream allowlist) + --require-hashes
RUN pip install --no-deps --require-hashes --index-url https://pypi.internal.example.com/simple -r requirements.lock

7. Regression Testing & Continuous Verification

  1. Write a Positive Unit Test confirming authorized, schema-valid requests succeed.
  2. Write a Negative Security Regression Test confirming unauthorized, cross-tenant, or malformed inputs are deterministically rejected.
  3. Re-run viperclaw taint and viperclaw verify to confirm zero remaining unmitigated flows in .viperclaw/graph.db.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.