Skip to content
Depfence

Depfence

github.com • November 29, 2026

Static analysis for dependency and CI/CD supply chain security. Catches attack classes that CVE-based scanners miss: prompt injection payloads, typosquatting variants LLMs hallucinate, fabricated SHA pins, Cordyceps-class CI/CD workflow attacks, MCP tool manipulation, and agent skill exploitation.

What depfence catches that others don't

Research contribution

Existing dependency scanners (Snyk, Dependabot, OSV-Scanner, Grype) focus on known CVEs in package version databases. depfence addresses a different threat model: attacks that exploit the AI-assisted development pipeline itself.

Novel attack classes covered by depfence that no CVE scanner detects:

Slopsquatting — packages named after hallucinated recommendations from large language models. depfence maintains a detection heuristic that flags typosquats matching patterns LLMs are known to fabricate.

Anti-analysis evasion — malware that uses fabricated system messages, CBRN refusal triggers, and legal threats to trick AI security agents into aborting analysis ( Gaslight technique , DPRK attribution).

MCP tool manipulation — tool shadowing, rug-pull attacks, and credential leakage in Model Context Protocol configurations across Claude Desktop, Cursor, VS Code, Windsurf, and Zed.

Agent skill attacks — external instruction fetch, domain spoofing, and deferred payload delivery targeting autonomous AI agents.

Fabricated pin verification — SHA pins and version numbers that don't exist in any registry, often hallucinated by coding assistants into CI workflows.

Cordyceps-class CI/CD attacks — workflow_run privilege escalation and issue_comment TOCTOU races in GitHub Actions.

depfence operates entirely via static analysis — no package code is executed, no source code leaves the local machine. All 56 scanners run concurrently with async metadata fetching across 14 package ecosystems.

Lockfile detection — auto-discovers package-lock.json , yarn.lock , pnpm-lock.yaml , requirements.txt , poetry.lock , Pipfile.lock , Cargo.lock , go.sum , uv.lock , packages.config , Gemfile.lock , composer.lock , Package.resolved , Podfile.lock , pubspec.lock , pom.xml , libs.versions.toml .

Metadata fetch — async batch fetch (20 concurrent) from npm, PyPI, etc.

Scanner execution — 53 entry-point scanners + 32 project scanners run concurrently.

Enrichment — EPSS exploit probability, CISA KEV status, OpenSSF Scorecard, and reachability analysis.

After enrichment, depfence:ignore suppressions and baseline snapshots are applied. Output formats: table, JSON, SARIF, HTML, CycloneDX, SPDX.

Invariants : depfence never executes package code. All analysis is local and static. No source code is transmitted to any external service. Network calls are limited to the endpoints in Network behavior and can be fully disabled with --no-fetch .

Ecosystems : npm, PyPI, Cargo, Go, Maven/Gradle, NuGet, RubyGems, Composer, Swift/SPM, Dart/Flutter, Docker, HuggingFace, MCP, GitHub Actions.

53 entry-point scanners + 32 project scanners. 56 scanner files total — many serve both roles.

EPSS — Exploit Prediction Scoring System probability on every CVE finding

CISA KEV — Known Exploited Vulnerabilities catalog flag

Risk scoring — composite A-F grades from EPSS + KEV + CVSS + reachability + Scorecard

SBOM — CycloneDX 1.5 and SPDX 2.3

Fabricated-pin verification

Most pinning linters check that a SHA string exists in an action reference. resolve_existence verifies the SHA references a real commit by querying the GitHub API.

When a fabricated pin has a # vX.Y.Z , the scanner resolves the real tag to characterize the fault: a long prefix match = "conflation" (real prefix + hallucinated tail). Valid commits whose tags moved are NOT flagged.

version_existence applies the same principle to package versions: requests==99.99.99 resolves to nothing on PyPI.

False positive discipline : yanked-but-real versions are never flagged. Network failures degrade to INFO. Both scanners gate on fetch_enabled() and respect --no-fetch .

Once published to PyPI: pip install depfence / pipx install depfence .

Python 3.10+. Tested on 3.10, 3.11, 3.12, 3.13. No native dependencies.

Claude Code — add the MCP server for inline security checks:

Or add to your project's .claude/settings.json :

Slash commands ( /depfence , /depfence-check ) are available in projects that include depfence's .claude/commands/ directory.

Codex — copy docs/AGENTS.md to .codex/AGENTS.md in your project for automatic pre-install checks.

A composite GitHub Action is defined in action.yml . Once a release tag is published: uses: ericrihm/depfence@v1 .

depfence.yml at project root:

Generate a starter config with depfence init . .

All source code and lockfiles are processed locally. No source code is transmitted. Scanners that make network calls:

Fully offline: depfence scan . --no-fetch .

JSON-RPC over stdio, compatible with Claude Desktop, Cursor, VS Code, Windsurf, Zed.

Custom scanners are discovered via pip entry points, DEPFENCE_PLUGIN_PATH , or ~/.depfence/plugins/ .

Project-level scanners use async def scan_project(self, project_dir: Path) -> list[Finding] instead.

resolve_existence and version_existence require network access. Without GITHUB_TOKEN , GitHub API is rate-limited to 60/hour.

Slopsquatting uses curated popular-package lists, not a complete registry mirror.

Prompt injection patterns are regex-based. Novel obfuscation techniques may evade detection.

EPSS and KEV enrichment require network access to FIRST.org and CISA APIs.

reachability performs static import tracing only. Dynamic imports ( importlib , __import__ ) are not resolved.

Heuristic scanners ( behavioral , reputation , obfuscation , payload_behavior ) produce false positives. Use depfence:ignore or baselines to suppress known-good patterns.

All detection is static. No dynamic analysis, sandboxed execution, or runtime monitoring.

Not yet published on PyPI. Install from source until the first release is published.

The GitHub Action ( action.yml ) will be available as uses: ericrihm/depfence@v1 after the first release tag.

Authoritative-source scanners ( resolve_existence , version_existence , osv , npm_advisory , pypi_advisory ) have zero expected false positives.

When to use something else

CVE/advisory scanning only : Dependabot, Snyk, or Grype have larger advisory databases.

Runtime behavioral analysis (sandboxed execution): depfence is purely static.

Container image scanning (not just Dockerfile linting): Trivy or Grype.

SAST (vulnerabilities in your own code): Semgrep or CodeQL.

depfence covers the gap between these tools: AI-specific supply chain threats, fabricated pins, prompt injection in dependencies, agent skill manipulation, and CI/CD workflow security that no other scanner detects.

3537 test functions across 136 test files (parametrized cases push the badge higher; this number is what a dependency-free count can assert). Run ruff check before opening a PR. See CONTRIBUTING.md for detailed guidelines.

Contributing guide — how to add scanners, run tests, submit PRs

Security policy — report vulnerabilities via GitHub security advisory

Issue templates — bug reports, false positives, feature requests

Changelog — release history

Apache License 2.0. See LICENSE .

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.

Extracted Entities