Ashrafiucse dependency vulns

From jiayaoqijia/cryptoskill · View interactive version

Ashrafiucse dependency vulns is an AI agent skill from the GitHub repository jiayaoqijia/cryptoskill. Checks project dependencies for known vulnerabilities (CVEs, GHSAs, PYSA, RUSTSEC, etc.) against the OSV.dev database. Finds lockfiles/manifests across npm, pip, Poetry, Bundler, Cargo, Composer, Go modules, Maven, NuGet, and Pub, queries live advisories for the exact installed versions, and also fl

How to use this skill

Skill file

Dependency Vulnerabilities

Step 1 — Automated scan (needs network)

python3 scripts/osv_scan.py <project_root>

Stdlib-only Python; parses lockfiles → queries the OSV.dev batch API → prints per-finding: advisory ID, aliases (CVEs), severity, and fixed versions. Read the script's header for supported manifests.

Interpretation rules:

Reachability (turn "present" into "used" or "dormant") — the severity multiplier for every finding above:

rg -n "require\(['\"]<pkg>|from ['\"]<pkg>|import <pkg>" -g '!*.lock'          # who imports it
rg -ln "require\(['\"]<pkg>" | rg "(routes|controllers|api|handlers|server|app)"  # do ROUTES reach it?

A vulnerable dep imported only by a build script is DORMANT (note + upgrade); imported from a request path is LIVE (severity stands). When node_modules/ is present, confirm the RESOLVED version matches the lockfile (cat node_modules/<pkg>/package.json | grep version) — vendored drift is common.

Step 2 — Manifest hygiene (no network needed)

Check and report:

rg --files -g 'package.json' -g 'pyproject.toml' -g 'Cargo.toml' -g 'go.mod' \
   -g 'Gemfile' -g 'composer.json' -g 'pom.xml' | head

Step 2.5 — Supply-chain hygiene (A08: confusion & typosquats)

rg -o '"@?[\w.-]+/[\w.-]+"|"[\w.-]+"' package.json | sort -u   # candidate names
npm view <name> versions --json 2>/dev/null || echo "not on public registry (good)"

With network: a npm view that SUCCEEDS for an internal name = CRITICAL (register a namespace/proxy instead). Without network: list internal-looking names for manual verification. Same check for pip (pip index versions) and Go private modules (GOPRIVATE vs proxy.golang.org reachable names).

```bash

rg -n -- "--require-hashes" requirements*.txt # no hit + pip ecosystem → MEDIUM: integrity not enforced

```

Step 2.7 — Beyond CVEs: dead, dangerous, and vendored packages

Advisory databases are silent on four classes that hit "clean main code, compromised system" — run the full pack in references/dangerous-packages.md:

  1. Discontinued/unfixable (vm2, request, …): flagged by PRESENCE, not advisory — any version is a finding when usage is security-relevant
  2. Compromised-release history (event-stream 3.3.6, ua-parser-js 0.7.29/0.8.1/1.0.12, eslint-scope 3.7.2, coa/rc 2021, node-ipc 11.x, cross-env 7.0.x): exact-version greps, zero network needed; a match means postinstall RAN — rotate credentials
  3. Dangerous usage of safe packages (lodash.merge(req.body), qs allowPrototypes, compile(userInput)): call-site risk, version is irrelevant
  4. Vendored/bundled copies (old jQuery/moment/AngularJS committed under public//vendor/dist): invisible to every manifest scanner — read the version banners

Reachability verdicts from Step 1 apply here too: vm2 present AND new VM() reachable from a route is a different finding than vm2 in devDependencies.

Step 3 — Runtime EOL check (live, free — endoflife.date)

For each runtime/framework/DB the project pins (from Phase 0 recon), check end-of-life status:

curl -s https://endoflife.date/api/nodejs.json | jq -r '.[] | "\(.cycle)  eol=\(.eol)  latest=\(.latest)"' | head -5

Common products: python, nodejs, php, ruby, go, laravel, django, rails,

ubuntu, debian, alpine, postgresql, mysql, redis, mongodb, nginx,

kubernetes. Compare the installed major/minor prefix against eol dates:

Step 4 — Prioritize output

Group findings: (a) fix available + reachable → do now; (b) fix available → next patch window; (c) no fix → mitigation notes (config workaround, feature flag off, WAF rule, virtual patching).

For each finding give: package@installed_version, advisory ID + CVE aliases, severity, fixed-in version, and the exact upgrade command for the package manager in use (npm install x@^y, pip install -U x==y, etc.).

Notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.