detecting-dependency-confusion
Detect and prevent dependency confusion (public-over-private package name resolution) in npm, PyPI, and Maven by enumerating claimable internal package names…
Skill by mukul975
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mukul975-detecting-dependency-confusion
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 2
codeload.github.com· found in install commandrubygems.org· found in code
Files it touches
~/.claude/skills/detecting-dependency-confusion
What's inside
- Skill name
detecting-dependency-confusion- Description
- Detect and prevent dependency confusion (public-over-private package name resolution) in npm, PyPI, and Maven by enumerating claimable internal package names with tools like `confused` and OWASP `dep-scan`, then enforcing source restrictions via `.npmrc`, `pip.conf`/`pyproject.toml`, and Maven `settings.xml`. Use when onboarding a repo to a supply-chain security program, auditing lockfiles/manifests for confusable dependencies, or after an incident that may have leaked internal package names.
- License
- Apache-2.0
- Instructions
- 203 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
- Instructions call the network
Files (5)
- LICENSE
- SKILL.md
- api-reference.md · references/
- standards.md · references/
- agent.py · scripts/
SKILL.md (first lines)
# Detecting Dependency Confusion
> **Legal Notice:** This skill is for authorized security testing, defensive engineering, and educational purposes only. Registering or claiming package namespaces you do not own, or testing build pipelines without written authorization, may be illegal and may violate the terms of service of public registries. Only run namespace-claiming or resolution-testing activities against names and infrastructure you control or are explicitly authorized to assess.
## Overview
Dependency confusion (also called a substitution or namespace-shadowing attack) was popularized by Alex Birsan in 2021 when he forced malicious code into the internal build systems of Apple, Microsoft, PayPal, and dozens of others. The root cause is that many package managers, when configured to resolve from both an internal/private registry and a public one, will prefer whichever copy has the **higher version number** rather than honoring the source. An attacker who learns the name of a private package (`@acme/internal-utils`, `acme-billing-sdk`) can publish a malicious package of the **same name** to the public registry (npmjs.com, PyPI, Maven Central) with a very high version (e.g. `99.0.0`). When the victim's CI/CD runner or a developer machine resolves dependencies, it pulls the attacker's public package, executes its install scripts, and the supply chain is compromised.
This skill covers both halves of the problem: **detection** — enumerating internal package names that are not registered (squatted defensively) on public registries and are therefore claimable, using `confused` and OWASP `dep-scan` — and **prevention** — pinning scopes/namespaces to private registries, registering placeholder packages, and enforcing source restrictions in `.npmrc`, `pip.conf`/`pyproject.toml`, and Maven `settings.xml`. Internal package names leak constantly: in committed lockfiles, sourcemaps, public JS bundles, Docker layers, and error stack traces, so this is treated as an attack-surface management problem, not a one-time check.
## When to Use
- When onboarding a repository or organization to a supply-chain security program and you need to baseline which internal packages are claimable on public registries.
- When CI/CD pipelines resolve dependencies from both private and public registries (mixed/hybrid feeds).
- After any incident where internal package names may have been exposed (leaked source, public bundle, breached repo).
- When auditing `package.json`, `requirements.txt`, `pom.xml`, `composer.json`, or `Gemfile.lock` files for confusable dependencies.
- As a recurring scheduled control to detect newly added internal packages that have not yet been defensively registered.
## Prerequisites
- Go 1.20+ to install `confused`:
```bash
go install github.com/visma-prodsec/confused@latest
# binary lands in $(go env GOPATH)/bin/confused
```
- Python 3.10+ for OWASP dep-scan:
```bash
pip install owasp-depscan
# or container: docker pull ghcr.io/owasp-dep-scan/dep-scan
```
- Node.js + npm (for `.npmrc` and `npm config` remediation) and access to your private registry (Artifactory, Nexus, Azure Artifacts, GitHub Packages, AWS CodeArtifact).
- Read access to the repositories / lockfiles being assessed and write access to your private registry for defensive registration.
## Objectives
- Enumerate every internal dependency declared in project manifests across npm, PyPI, Maven, Composer, and RubyGems.
- Determine which internal names are **not** present on the corresponding public registry and are therefore claimable.
- Distinguish true exposure from false positives (scoped packages, already-mirrored names).
- Apply registry-pinning and scope-restriction controls that make public substitution impossible.
- Defensively register placeholder packages for unclaimed internal names.
- Establish a recurring detection control in CI to catch newly introduced confusable dependencies.
## MITRE ATT&CK Mapping
| Technique ID | Technique Name | Relevance |
|--------------|----------------|-----------|
| T1195.001 | Supply Chain Compromise: Compromise Software Dependencies and Development Tools | Core technique — attacker substitutes a malicious public package for an internal dependency. |
| T1195.002 | Supply Chain Compromise: Compromise Software Supply Chain | Broader category covering the compromised build artifacts produced once confusion succeeds. |
| T1059.007 | Command and Scripting Interpreter: JavaScript | npm `preinstall`/`postinstall` lifecycle scripts execute attacker JavaScript on resolution. |
| T1071.001 | Application Layer Protocol: Web Protocols | Substituted package beacons stolen environment/credentials to attacker HTTP(S) endpoint. |
## Workflow
### 1. Inventory manifests across the codebase
Locate every dependency manifest so nothing is missed.
```bash
# Find all supported manifests in a monorepo
find . -type f \( \
-name package.json -o \
-name requirements.txt -o \
-name pom.xml -o \
-name composer.json -o \
-name Gemfile.lock \
\) -not -path '*/node_modules/*' -print
```
### 2. Scan npm manifests with confused
`confused` reads the manifest and reports every dependency name **not found** on the public registry — those are candidates for confusion.
```bash
# npm (default language is npm)
confused -l npm package.json
# Treat your known-good scopes as secure to suppress false positives (supports wildcards)
confused -l npm -s '@acme/*,@acme-internal/*' package.json
# Verbose, to see each lookup
confused -l npm -v package.json
```
### 3. Scan PyPI, Maven, Composer, and RubyGems manifests
The `-l` flag selects the ecosystem; each maps to its standard manifest file.
```bash
confused -l pip requirements.txt # PyPI -> requirements.txt
confused -l mvn pom.xml # Maven -> pom.xml
confused -l composer composer.json # PHP -> composer.json
confused -l rubygems Gemfile.lock # Ruby -> Gemfile.lock
```
### 4. Cross-check with OWASP dep-scan private-namespace mode
dep-scan confirms confusion exposure for declared private namespaces and folds it into a broader risk audit.
```bash
# Flag private namespaces accidentally claimable on public registries
depscan --src $PWD --reports-dir ./reports \
--private-ns acme,acme_internal,@acme
# Enable deep package risk audit (npm + pypi): typosquats, takeover risk, etc.
depscan --src $PWD --reports-dir ./reports --risk-audit
```
### 5. Triage candidates and confirm claimability
For each flagged name, verify it is genuinely absent on the public registry (a 404 means claimable).
```bash
# npm: a 404 status means the name is unregistered on the public registry
curl -s -o /dev/null -w "%{http_code}\n" https://registry.npmjs.org/@acme%2finternal-utils
# PyPI: 404 from the JSON API means the project name is free
curl -s -o /dev/null -w "%{http_code}\n" https://pypi.org/pypi/acme-billing-sdk/json
```
### 6. Remediate npm with scope-to-registry pinning
Bind every internal scope to the private registry so a public package of the same name can never be resolved.
```ini
# .npmrc (project root, committed)
@acme:registry=https://artifactory.example.com/api/npm/npm-internal/
//artifactory.example.com/api/npm/npm-internal/:_authToken=${NPM_TOKEN}
# Force the default registry to a single proxy that does NOT merge public + private
registry=https://artifactory.example.com/api/npm/npm-virtual/
```
Verify the resolution source before installing:From mukul975/Anthropic-Cybersecurity-Skills, Apache-2.0.
More from mukul975/Anthropic-Cybersecurity-Skills
- 0.616score
conducting-spearphishing-simulation-campaign
mukul975
Run a targeted spearphishing simulation for initial access by developing OSINT-derived pretexts, building payloads (HTML smuggling, macro docs, ISO/LNK…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-social-engineering-penetration-test
mukul975
Design and execute a social engineering penetration test combining OSINT-driven target profiling with phishing, vishing, smishing, and physical pretexting…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-domain-persistence-with-dcsync
mukul975
Perform DCSync attacks by abusing MS-DRSR replication rights (DS-Replication-Get-Changes/-All) to impersonate a Domain Controller and extract KRBTGT, Domain…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-threat-intelligence-platform
mukul975
Design and deploy a Threat Intelligence Platform (TIP) by integrating open-source CTI tools (MISP, OpenCTI, TheHive, Cortex) into a unified system with feed…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-threat-intelligence-enrichment-in-splunk
mukul975
Build automated IOC enrichment pipelines in Splunk Enterprise Security by ingesting threat feeds into KV Store collections and correlating them against…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-vulnerability-aging-and-sla-tracking
mukul975
Implement a vulnerability aging dashboard and SLA tracking system that measures time-to-remediation against severity-based deadlines (e.g.
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
analyzing-cobaltstrike-malleable-c2-profiles
mukul975
Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
attacking-oauth-with-device-code-phishing
mukul975
Run OAuth 2.0 device-code and illicit-consent phishing attacks against Microsoft Entra ID, using TokenTactics-style tooling to steal access and refresh…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-external-reconnaissance-with-osint
mukul975
Conduct external recon using OSINT techniques to map an organization's external attack surface without touching target systems, gathering DNS records…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-malware-incident-communication-template
mukul975
Build structured communication templates for malware incidents (ransomware, wiper, trojan, worm), covering internal stakeholder notifications, executive…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-gdpr-compliance-assessment
mukul975
Conduct comprehensive GDPR compliance assessments by evaluating data processing activities against EU Regulation 2016/679, including Article 30 records of…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
configuring-active-directory-tiered-model
mukul975
Implement Microsoft's Enhanced Security Admin Environment (ESAE) tiered administration model for Active Directory, covering Tier 0/1/2 separation, privileged…
SkillBFreshness: B★ 34.9KClaude Code +9
Compare and alternatives
Featured in
Signals
- Stars
- 34,941
- Forks
- 4,256
- Open issues
- 24
- Last commit (this folder)
- Aug 2, 2026 (2 months ago)
- Last release
- Jun 22, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from mukul975
- 0.616score
building-threat-intelligence-enrichment-in-splunk
mukul975
Build automated IOC enrichment pipelines in Splunk Enterprise Security by ingesting threat feeds into KV Store collections and correlating them against…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-threat-intelligence-platform
mukul975
Design and deploy a Threat Intelligence Platform (TIP) by integrating open-source CTI tools (MISP, OpenCTI, TheHive, Cortex) into a unified system with feed…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
building-vulnerability-aging-and-sla-tracking
mukul975
Implement a vulnerability aging dashboard and SLA tracking system that measures time-to-remediation against severity-based deadlines (e.g.
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-domain-persistence-with-dcsync
mukul975
Perform DCSync attacks by abusing MS-DRSR replication rights (DS-Replication-Get-Changes/-All) to impersonate a Domain Controller and extract KRBTGT, Domain…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-external-reconnaissance-with-osint
mukul975
Conduct external recon using OSINT techniques to map an organization's external attack surface without touching target systems, gathering DNS records…
SkillBFreshness: B★ 34.9KClaude Code +9 - 0.616score
conducting-gdpr-compliance-assessment
mukul975
Conduct comprehensive GDPR compliance assessments by evaluating data processing activities against EU Regulation 2016/679, including Article 30 records of…
SkillBFreshness: B★ 34.9KClaude Code +9
Cite this page
detecting-dependency-confusion skill. Agent Mart. https://agentmart.dev/skills/mukul975-detecting-dependency-confusion (last updated 2026-10-24)