[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AEC2ED0DN6TAWKW0NVFY7A":3,"skill-same:01M6AEC2ED0DN6TAWKW0NVFY7A":104},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":59,"commitSha":60,"skillDirectory":61,"forksCount":62,"repositoryHtmlUrl":63,"repositoryHomepageUrl":64,"ownerHtmlUrl":65,"ownerBlogUrl":66,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M6AEC2ED0DN6TAWKW0NVFY7A","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 with tools like `confused` and OWASP `dep-scan`, then enforcing source restrictions via `.npmrc`, `pip.conf`\u002F`pyproject.toml`, and Maven `settings.xml`. Use when onboarding a repo to a supply-chain security program, auditing lockfiles\u002Fmanifests for confusable dependencies, or after an incident that may have leaked internal package names.","检测并防范 npm、PyPI 和 Maven 中的依赖混淆（公有包覆盖私有包名解析）：使用 confused 和 OWASP dep-scan 等工具枚举可抢注的内部包名，再通过 .npmrc、pip.conf\u002Fpyproject.toml 和 Maven settings.xml 强制实施源限制。适用于将代码仓库纳入供应链安全计划、审计锁文件\u002F清单中的可混淆依赖，或发生在可能已泄露内部包名的安全事件之后。","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",36146,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdetecting-dependency-confusion\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C32Q37WAMK06SGMFC02VFP","软件供应链安全","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"detecting dependency confusion","devsecops","security","cybersecurity","npm","onboarding","package","xml","pypi","supply-chain","dependency-confusion","owasp","supply-chain-security","maven","package-management","namespace-hijacking","2026-11-10 10:12:30",false,"---\nname: detecting-dependency-confusion\ndescription: 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`\u002F`pyproject.toml`, and Maven `settings.xml`. Use when onboarding a repo to a supply-chain security program, auditing lockfiles\u002Fmanifests for confusable dependencies, or after an incident that may have leaked internal package names.\ndomain: cybersecurity\nsubdomain: supply-chain-security\ntags:\n- supply-chain-security\n- dependency-confusion\n- npm\n- pypi\n- maven\n- package-management\n- devsecops\n- namespace-hijacking\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- ID.RA-09\nmitre_attack:\n- T1195.001\n---\n# Detecting Dependency Confusion\n\n> **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.\n\n## Overview\n\nDependency 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\u002Fprivate 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\u002Finternal-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\u002FCD runner or a developer machine resolves dependencies, it pulls the attacker's public package, executes its install scripts, and the supply chain is compromised.\n\nThis 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\u002Fnamespaces to private registries, registering placeholder packages, and enforcing source restrictions in `.npmrc`, `pip.conf`\u002F`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.\n\n## When to Use\n\n- 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.\n- When CI\u002FCD pipelines resolve dependencies from both private and public registries (mixed\u002Fhybrid feeds).\n- After any incident where internal package names may have been exposed (leaked source, public bundle, breached repo).\n- When auditing `package.json`, `requirements.txt`, `pom.xml`, `composer.json`, or `Gemfile.lock` files for confusable dependencies.\n- As a recurring scheduled control to detect newly added internal packages that have not yet been defensively registered.\n\n## Prerequisites\n\n- Go 1.20+ to install `confused`:\n  ```bash\n  go install github.com\u002Fvisma-prodsec\u002Fconfused@latest\n  # binary lands in $(go env GOPATH)\u002Fbin\u002Fconfused\n  ```\n- Python 3.10+ for OWASP dep-scan:\n  ```bash\n  pip install owasp-depscan\n  # or container: docker pull ghcr.io\u002Fowasp-dep-scan\u002Fdep-scan\n  ```\n- Node.js + npm (for `.npmrc` and `npm config` remediation) and access to your private registry (Artifactory, Nexus, Azure Artifacts, GitHub Packages, AWS CodeArtifact).\n- Read access to the repositories \u002F lockfiles being assessed and write access to your private registry for defensive registration.\n\n## Objectives\n\n- Enumerate every internal dependency declared in project manifests across npm, PyPI, Maven, Composer, and RubyGems.\n- Determine which internal names are **not** present on the corresponding public registry and are therefore claimable.\n- Distinguish true exposure from false positives (scoped packages, already-mirrored names).\n- Apply registry-pinning and scope-restriction controls that make public substitution impossible.\n- Defensively register placeholder packages for unclaimed internal names.\n- Establish a recurring detection control in CI to catch newly introduced confusable dependencies.\n\n## MITRE ATT&CK Mapping\n\n| Technique ID | Technique Name | Relevance |\n|--------------|----------------|-----------|\n| T1195.001 | Supply Chain Compromise: Compromise Software Dependencies and Development Tools | Core technique — attacker substitutes a malicious public package for an internal dependency. |\n| T1195.002 | Supply Chain Compromise: Compromise Software Supply Chain | Broader category covering the compromised build artifacts produced once confusion succeeds. |\n| T1059.007 | Command and Scripting Interpreter: JavaScript | npm `preinstall`\u002F`postinstall` lifecycle scripts execute attacker JavaScript on resolution. |\n| T1071.001 | Application Layer Protocol: Web Protocols | Substituted package beacons stolen environment\u002Fcredentials to attacker HTTP(S) endpoint. |\n\n## Workflow\n\n### 1. Inventory manifests across the codebase\nLocate every dependency manifest so nothing is missed.\n```bash\n# Find all supported manifests in a monorepo\nfind . -type f \\( \\\n  -name package.json -o \\\n  -name requirements.txt -o \\\n  -name pom.xml -o \\\n  -name composer.json -o \\\n  -name Gemfile.lock \\\n\\) -not -path '*\u002Fnode_modules\u002F*' -print\n```\n\n### 2. Scan npm manifests with confused\n`confused` reads the manifest and reports every dependency name **not found** on the public registry — those are candidates for confusion.\n```bash\n# npm (default language is npm)\nconfused -l npm package.json\n\n# Treat your known-good scopes as secure to suppress false positives (supports wildcards)\nconfused -l npm -s '@acme\u002F*,@acme-internal\u002F*' package.json\n\n# Verbose, to see each lookup\nconfused -l npm -v package.json\n```\n\n### 3. Scan PyPI, Maven, Composer, and RubyGems manifests\nThe `-l` flag selects the ecosystem; each maps to its standard manifest file.\n```bash\nconfused -l pip requirements.txt          # PyPI  -> requirements.txt\nconfused -l mvn pom.xml                    # Maven -> pom.xml\nconfused -l composer composer.json        # PHP   -> composer.json\nconfused -l rubygems Gemfile.lock         # Ruby  -> Gemfile.lock\n```\n\n### 4. Cross-check with OWASP dep-scan private-namespace mode\ndep-scan confirms confusion exposure for declared private namespaces and folds it into a broader risk audit.\n```bash\n# Flag private namespaces accidentally claimable on public registries\ndepscan --src $PWD --reports-dir .\u002Freports \\\n  --private-ns acme,acme_internal,@acme\n\n# Enable deep package risk audit (npm + pypi): typosquats, takeover risk, etc.\ndepscan --src $PWD --reports-dir .\u002Freports --risk-audit\n```\n\n### 5. Triage candidates and confirm claimability\nFor each flagged name, verify it is genuinely absent on the public registry (a 404 means claimable).\n```bash\n# npm: a 404 status means the name is unregistered on the public registry\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\\n\" https:\u002F\u002Fregistry.npmjs.org\u002F@acme%2finternal-utils\n\n# PyPI: 404 from the JSON API means the project name is free\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\\n\" https:\u002F\u002Fpypi.org\u002Fpypi\u002Facme-billing-sdk\u002Fjson\n```\n\n### 6. Remediate npm with scope-to-registry pinning\nBind every internal scope to the private registry so a public package of the same name can never be resolved.\n```ini\n# .npmrc (project root, committed)\n@acme:registry=https:\u002F\u002Fartifactory.example.com\u002Fapi\u002Fnpm\u002Fnpm-internal\u002F\n\u002F\u002Fartifactory.example.com\u002Fapi\u002Fnpm\u002Fnpm-internal\u002F:_authToken=${NPM_TOKEN}\n\n# Force the default registry to a single proxy that does NOT merge public + private\nregistry=https:\u002F\u002Fartifactory.example.com\u002Fapi\u002Fnpm\u002Fnpm-virtual\u002F\n```\nVerify the resolution source before installing:\n```bash\nnpm config get @acme:registry\nnpm install --dry-run   # confirm @acme\u002F* resolves from the private host\n```\n\n### 7. Remediate PyPI and Maven\nPin Python index resolution and Maven mirroring so public sources cannot shadow internal artifacts.\n```toml\n# pyproject.toml (PEP 621 \u002F pip >= 23): explicit index pinning\n[tool.pip]\nindex-url = \"https:\u002F\u002Fartifactory.example.com\u002Fapi\u002Fpypi\u002Fpypi-internal\u002Fsimple\u002F\"\n# Do NOT use extra-index-url for internal packages — pip merges and picks highest version.\n```\n```xml\n\u003C!-- ~\u002F.m2\u002Fsettings.xml: mirror everything through a single virtual repo -->\n\u003Cmirrors>\n  \u003Cmirror>\n    \u003Cid>internal-virtual\u003C\u002Fid>\n    \u003CmirrorOf>*\u003C\u002FmirrorOf>\n    \u003Curl>https:\u002F\u002Fartifactory.example.com\u002Fartifactory\u002Fmaven-virtual\u003C\u002Furl>\n  \u003C\u002Fmirror>\n\u003C\u002Fmirrors>\n```\n\n### 8. Defensively register placeholder packages\nFor names you cannot fully isolate, claim the public name yourself with an empty, non-functional placeholder so an attacker cannot.\n```bash\n# npm placeholder claim (scoped, public)\nmkdir acme-internal-utils && cd acme-internal-utils\nnpm init -y\nnpm pkg set version=0.0.1-placeholder description=\"Reserved internal name. Do not use.\"\nnpm publish --access public\n```\n\n### 9. Wire detection into CI\nFail the pipeline if any new confusable dependency appears.\n```yaml\n# .github\u002Fworkflows\u002Fdepconfusion.yml\nname: dependency-confusion\non: [push, pull_request]\njobs:\n  confused:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: actions\u002Fsetup-go@v5\n        with: { go-version: '1.22' }\n      - run: go install github.com\u002Fvisma-prodsec\u002Fconfused@latest\n      - name: Scan npm manifest\n        run: $(go env GOPATH)\u002Fbin\u002Fconfused -l npm -s '@acme\u002F*' package.json\n```\n\n### 10. Run the bundled helper for batch triage\nUse the included `agent.py` to scan a tree and emit a structured report combining `confused` and live registry probes.\n```bash\npython scripts\u002Fagent.py --path . --ecosystem npm \\\n  --secure-namespaces '@acme\u002F*,@acme-internal\u002F*' \\\n  --output report.json\n```\n\n## Tools and Resources\n\n| Tool | Purpose | Source |\n|------|---------|--------|\n| confused | Detect lingering free namespaces for declared dependencies | https:\u002F\u002Fgithub.com\u002Fvisma-prodsec\u002Fconfused |\n| ConfusedDotnet | Same check for NuGet\u002F.NET | https:\u002F\u002Fgithub.com\u002Fvisma-prodsec\u002FConfusedDotnet |\n| OWASP dep-scan | Risk audit incl. `--private-ns` confusion check | https:\u002F\u002Fgithub.com\u002Fowasp-dep-scan\u002Fdep-scan |\n| OWASP CI\u002FCD Top 10 | CICD-SEC-03 Dependency Chain Abuse | https:\u002F\u002Fowasp.org\u002Fwww-project-top-10-ci-cd-security-risks\u002F |\n| Birsan research | Original dependency confusion writeup | https:\u002F\u002Fmedium.com\u002F@alex.birsan\u002Fdependency-confusion-4a5d60fec610 |\n| npm scopes docs | Scope-to-registry pinning reference | https:\u002F\u002Fdocs.npmjs.com\u002Fcli\u002Fv10\u002Fusing-npm\u002Fscope |\n\n## Validation Criteria\n\n- [ ] All dependency manifests in the codebase enumerated.\n- [ ] `confused` run for every relevant ecosystem with secure namespaces supplied.\n- [ ] OWASP dep-scan `--private-ns` run and reconciled with `confused` output.\n- [ ] Each flagged name confirmed claimable (404) or dismissed as a false positive.\n- [ ] Internal scopes pinned to the private registry in `.npmrc` \u002F `pip` config \u002F Maven mirror.\n- [ ] `extra-index-url` and merged virtual feeds reviewed for highest-version pull risk.\n- [ ] Placeholder packages registered for names that cannot be isolated.\n- [ ] CI job enforces the check on every push\u002FPR.\n- [ ] Findings documented with owner and remediation status.\n","# Detecting Dependency Confusion\n\n> **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.\n\n## Overview\n\nDependency 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\u002Fprivate 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\u002Finternal-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\u002FCD runner or a developer machine resolves dependencies, it pulls the attacker's public package, executes its install scripts, and the supply chain is compromised.\n\nThis 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\u002Fnamespaces to private registries, registering placeholder packages, and enforcing source restrictions in `.npmrc`, `pip.conf`\u002F`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.\n\n## When to Use\n\n- 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.\n- When CI\u002FCD pipelines resolve dependencies from both private and public registries (mixed\u002Fhybrid feeds).\n- After any incident where internal package names may have been exposed (leaked source, public bundle, breached repo).\n- When auditing `package.json`, `requirements.txt`, `pom.xml`, `composer.json`, or `Gemfile.lock` files for confusable dependencies.\n- As a recurring scheduled control to detect newly added internal packages that have not yet been defensively registered.\n\n## Prerequisites\n\n- Go 1.20+ to install `confused`:\n  ```bash\n  go install github.com\u002Fvisma-prodsec\u002Fconfused@latest\n  # binary lands in $(go env GOPATH)\u002Fbin\u002Fconfused\n  ```\n- Python 3.10+ for OWASP dep-scan:\n  ```bash\n  pip install owasp-depscan\n  # or container: docker pull ghcr.io\u002Fowasp-dep-scan\u002Fdep-scan\n  ```\n- Node.js + npm (for `.npmrc` and `npm config` remediation) and access to your private registry (Artifactory, Nexus, Azure Artifacts, GitHub Packages, AWS CodeArtifact).\n- Read access to the repositories \u002F lockfiles being assessed and write access to your private registry for defensive registration.\n\n## Objectives\n\n- Enumerate every internal dependency declared in project manifests across npm, PyPI, Maven, Composer, and RubyGems.\n- Determine which internal names are **not** present on the corresponding public registry and are therefore claimable.\n- Distinguish true exposure from false positives (scoped packages, already-mirrored names).\n- Apply registry-pinning and scope-restriction controls that make public substitution impossible.\n- Defensively register placeholder packages for unclaimed internal names.\n- Establish a recurring detection control in CI to catch newly introduced confusable dependencies.\n\n## MITRE ATT&CK Mapping\n\n| Technique ID | Technique Name | Relevance |\n|--------------|----------------|-----------|\n| T1195.001 | Supply Chain Compromise: Compromise Software Dependencies and Development Tools | Core technique — attacker substitutes a malicious public package for an internal dependency. |\n| T1195.002 | Supply Chain Compromise: Compromise Software Supply Chain | Broader category covering the compromised build artifacts produced once confusion succeeds. |\n| T1059.007 | Command and Scripting Interpreter: JavaScript | npm `preinstall`\u002F`postinstall` lifecycle scripts execute attacker JavaScript on resolution. |\n| T1071.001 | Application Layer Protocol: Web Protocols | Substituted package beacons stolen environment\u002Fcredentials to attacker HTTP(S) endpoint. |\n\n## Workflow\n\n### 1. Inventory manifests across the codebase\nLocate every dependency manifest so nothing is missed.\n```bash\n# Find all supported manifests in a monorepo\nfind . -type f \\( \\\n  -name package.json -o \\\n  -name requirements.txt -o \\\n  -name pom.xml -o \\\n  -name composer.json -o \\\n  -name Gemfile.lock \\\n\\) -not -path '*\u002Fnode_modules\u002F*' -print\n```\n\n### 2. Scan npm manifests with confused\n`confused` reads the manifest and reports every dependency name **not found** on the public registry — those are candidates for confusion.\n```bash\n# npm (default language is npm)\nconfused -l npm package.json\n\n# Treat your known-good scopes as secure to suppress false positives (supports wildcards)\nconfused -l npm -s '@acme\u002F*,@acme-internal\u002F*' package.json\n\n# Verbose, to see each lookup\nconfused -l npm -v package.json\n```\n\n### 3. Scan PyPI, Maven, Composer, and RubyGems manifests\nThe `-l` flag selects the ecosystem; each maps to its standard manifest file.\n```bash\nconfused -l pip requirements.txt          # PyPI  -> requirements.txt\nconfused -l mvn pom.xml                    # Maven -> pom.xml\nconfused -l composer composer.json        # PHP   -> composer.json\nconfused -l rubygems Gemfile.lock         # Ruby  -> Gemfile.lock\n```\n\n### 4. Cross-check with OWASP dep-scan private-namespace mode\ndep-scan confirms confusion exposure for declared private namespaces and folds it into a broader risk audit.\n```bash\n# Flag private namespaces accidentally claimable on public registries\ndepscan --src $PWD --reports-dir .\u002Freports \\\n  --private-ns acme,acme_internal,@acme\n\n# Enable deep package risk audit (npm + pypi): typosquats, takeover risk, etc.\ndepscan --src $PWD --reports-dir .\u002Freports --risk-audit\n```\n\n### 5. Triage candidates and confirm claimability\nFor each flagged name, verify it is genuinely absent on the public registry (a 404 means claimable).\n```bash\n# npm: a 404 status means the name is unregistered on the public registry\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\\n\" https:\u002F\u002Fregistry.npmjs.org\u002F@acme%2finternal-utils\n\n# PyPI: 404 from the JSON API means the project name is free\ncurl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\\n\" https:\u002F\u002Fpypi.org\u002Fpypi\u002Facme-billing-sdk\u002Fjson\n```\n\n### 6. Remediate npm with scope-to-registry pinning\nBind every internal scope to the private registry so a public package of the same name can never be resolved.\n```ini\n# .npmrc (project root, committed)\n@acme:registry=https:\u002F\u002Fartifactory.example.com\u002Fapi\u002Fnpm\u002Fnpm-internal\u002F\n\u002F\u002Fartifactory.example.com\u002Fapi\u002Fnpm\u002Fnpm-internal\u002F:_authToken=${NPM_TOKEN}\n\n# Force the default registry to a single proxy that does NOT merge public + private\nregistry=https:\u002F\u002Fartifactory.example.com\u002Fapi\u002Fnpm\u002Fnpm-virtual\u002F\n```\nVerify the resolution source before installing:\n```bash\nnpm config get @acme:registry\nnpm install --dry-run   # confirm @acme\u002F* resolves from the private host\n```\n\n### 7. Remediate PyPI and Maven\nPin Python index resolution and Maven mirroring so public sources cannot shadow internal artifacts.\n```toml\n# pyproject.toml (PEP 621 \u002F pip >= 23): explicit index pinning\n[tool.pip]\nindex-url = \"https:\u002F\u002Fartifactory.example.com\u002Fapi\u002Fpypi\u002Fpypi-internal\u002Fsimple\u002F\"\n# Do NOT use extra-index-url for internal packages — pip merges and picks highest version.\n```\n```xml\n\u003C!-- ~\u002F.m2\u002Fsettings.xml: mirror everything through a single virtual repo -->\n\u003Cmirrors>\n  \u003Cmirror>\n    \u003Cid>internal-virtual\u003C\u002Fid>\n    \u003CmirrorOf>*\u003C\u002FmirrorOf>\n    \u003Curl>https:\u002F\u002Fartifactory.example.com\u002Fartifactory\u002Fmaven-virtual\u003C\u002Furl>\n  \u003C\u002Fmirror>\n\u003C\u002Fmirrors>\n```\n\n### 8. Defensively register placeholder packages\nFor names you cannot fully isolate, claim the public name yourself with an empty, non-functional placeholder so an attacker cannot.\n```bash\n# npm placeholder claim (scoped, public)\nmkdir acme-internal-utils && cd acme-internal-utils\nnpm init -y\nnpm pkg set version=0.0.1-placeholder description=\"Reserved internal name. Do not use.\"\nnpm publish --access public\n```\n\n### 9. Wire detection into CI\nFail the pipeline if any new confusable dependency appears.\n```yaml\n# .github\u002Fworkflows\u002Fdepconfusion.yml\nname: dependency-confusion\non: [push, pull_request]\njobs:\n  confused:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: actions\u002Fsetup-go@v5\n        with: { go-version: '1.22' }\n      - run: go install github.com\u002Fvisma-prodsec\u002Fconfused@latest\n      - name: Scan npm manifest\n        run: $(go env GOPATH)\u002Fbin\u002Fconfused -l npm -s '@acme\u002F*' package.json\n```\n\n### 10. Run the bundled helper for batch triage\nUse the included `agent.py` to scan a tree and emit a structured report combining `confused` and live registry probes.\n```bash\npython scripts\u002Fagent.py --path . --ecosystem npm \\\n  --secure-namespaces '@acme\u002F*,@acme-internal\u002F*' \\\n  --output report.json\n```\n\n## Tools and Resources\n\n| Tool | Purpose | Source |\n|------|---------|--------|\n| confused | Detect lingering free namespaces for declared dependencies | https:\u002F\u002Fgithub.com\u002Fvisma-prodsec\u002Fconfused |\n| ConfusedDotnet | Same check for NuGet\u002F.NET | https:\u002F\u002Fgithub.com\u002Fvisma-prodsec\u002FConfusedDotnet |\n| OWASP dep-scan | Risk audit incl. `--private-ns` confusion check | https:\u002F\u002Fgithub.com\u002Fowasp-dep-scan\u002Fdep-scan |\n| OWASP CI\u002FCD Top 10 | CICD-SEC-03 Dependency Chain Abuse | https:\u002F\u002Fowasp.org\u002Fwww-project-top-10-ci-cd-security-risks\u002F |\n| Birsan research | Original dependency confusion writeup | https:\u002F\u002Fmedium.com\u002F@alex.birsan\u002Fdependency-confusion-4a5d60fec610 |\n| npm scopes docs | Scope-to-registry pinning reference | https:\u002F\u002Fdocs.npmjs.com\u002Fcli\u002Fv10\u002Fusing-npm\u002Fscope |\n\n## Validation Criteria\n\n- [ ] All dependency manifests in the codebase enumerated.\n- [ ] `confused` run for every relevant ecosystem with secure namespaces supplied.\n- [ ] OWASP dep-scan `--private-ns` run and reconciled with `confused` output.\n- [ ] Each flagged name confirmed claimable (404) or dismissed as a false positive.\n- [ ] Internal scopes pinned to the private registry in `.npmrc` \u002F `pip` config \u002F Maven mirror.\n- [ ] `extra-index-url` and merged virtual feeds reviewed for highest-version pull risk.\n- [ ] Placeholder packages registered for names that cannot be isolated.\n- [ ] CI job enforces the check on every push\u002FPR.\n- [ ] Findings documented with owner and remediation status.\n",{"name":5,"tags":52,"author":53,"domain":34,"license":16,"version":54,"nist_csf":55,"subdomain":43,"description":7,"mitre_attack":57},[43,41,35,39,44,45,32,46],"mahipal","1.0",[56],"ID.RA-09",[58],"T1195.001","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fdetecting-dependency-confusion",4425,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":9,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill detecting-dependency-confusion",{"tool":75,"command":76},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill detecting-dependency-confusion",{"tool":78,"command":79},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill detecting-dependency-confusion","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdetecting-dependency-confusion\u002FSKILL.md",true,[83,88,94,98],{"path":84,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdetecting-dependency-confusion\u002FLICENSE",{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fapi-reference.md","REFERENCE","参考文档",2275,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdetecting-dependency-confusion\u002Freferences\u002Fapi-reference.md",{"path":95,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fstandards.md",1643,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdetecting-dependency-confusion\u002Freferences\u002Fstandards.md",{"path":99,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":102,"sourceHtmlUrl":103},"scripts\u002Fagent.py","SCRIPT","脚本",5913,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdetecting-dependency-confusion\u002Fscripts\u002Fagent.py",[105,132,161,193,224,256],{"skillNo":106,"name":107,"nameZh":108,"description":109,"descriptionZh":110,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":111,"categories":112,"keywords":115,"publishedAt":47},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","SLSA 构建来源验证","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","使用 Sigstore 的 cosign（verify、verify-attestation、verify-blob-attestation）和 slsa-verifier（verify-artifact）验证工件签名和 SLSA 来源（provenance），强制校验 keyless OIDC 构建者身份和源仓库是否符合 SLSA Build 级别。适用于 CI\u002FCD 中部署工件前、消费第三方证明时、建立 SLSA Build L3 管道，或在事件响应或准入控制期间确认来源的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[113,114],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[116,117,118,119,33,34,120,121,122,123,124,125,40,126,43,127,128,129,130,131],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","incident response","identity","pr","code","artifacts","ci","pipeline","t1195","attestation","code-signing","cosign","keyless",{"skillNo":133,"name":134,"nameZh":135,"description":136,"descriptionZh":137,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":138,"categories":139,"keywords":144,"publishedAt":47},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","TPM 测量启动验证","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","使用 tpm2-tools 验证 TPM 2.0 测量启动（measured boot）的完整性和远程证明：读取 PCR（tpm2_pcrread）、重放启动事件日志、生成并检查签名报价（tpm2_quote\u002Ftpm2_checkquote），以及将机密封印（seal）到 PCR 策略。适用于确认系统已启动可信固件\u002F内核以实现零信任（Zero Trust）设备状态、通过 PCR 漂移检测启动链篡改，或构建黄金值基线用于机群（fleet）证明。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[140,141],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":142,"categoryName":143,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C89JJEXGGRGHS6XVXDA46K","终端安全加固",[145,128,146,147,33,148,34,122,149,150,151,152,153,154,155,156,157,158,159,160],"boot","TPM","validating tpm measured boot attestation","policy","verification","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":162,"name":163,"nameZh":164,"description":165,"descriptionZh":166,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":167,"categories":168,"keywords":175,"publishedAt":47},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","备份完整性验证","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","通过加密哈希验证、自动化恢复测试、损坏检测和可恢复性检查来验证备份完整性，确认备份对于灾难恢复和勒索软件响应是可靠的。适用于在依赖备份进行恢复之前、构建备份后验证管道、审计备份基础设施以满足合规要求，或检查不可变\u002Fair-gapped（气隙）备份是否存在静默损坏或篡改的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[169,172],{"categoryNo":170,"categoryName":171,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD4WETX0HM3SM9QKQ15B","SRE 工程师",{"categoryNo":173,"categoryName":174,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSSTY86MWS6W5GDQWB1ADQ","备份与灾难恢复",[155,176,177,178,179,34,180,181,149,182,183,184,185,186,187,188,189,190,191,192],"backup","recovery","validating backup integrity for recovery","testing","infrastructure","validation","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":194,"name":195,"nameZh":196,"description":197,"descriptionZh":198,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":199,"categories":200,"keywords":205,"publishedAt":47},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","KAPE Windows 取证收集","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","运行 KAPE（Kroll Artifact Parser and Extractor），通过 Targets 收集目标取证工件（注册表配置单元、$MFT、事件日志、prefetch、浏览器数据），并使用封装 Eric Zimmerman 的 EZ Tools（PECmd、MFTECmd、RECmd）的 Modules 进行解析。适用于事件遏制\u002F分诊早期阶段——此时完整磁盘镜像不切实际，但需要快速获得可采信、可解析的 Windows 工件集，包括大规模远程收集。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[201,202],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":203,"categoryName":204,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C9JZH3GWXPJ6CQG5P7J48Y","数字取证与电子证据分析",[206,207,208,34,209,210,211,212,213,214,215,216,217,218,219,220,152,221,222,223],"windows","kape","triaging windows with kape","registry","browser","logs","windows-forensics","dfir","mft","mftecmd","data","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":225,"name":226,"nameZh":227,"description":228,"descriptionZh":229,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":230,"categories":231,"keywords":236,"publishedAt":47},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","SSVC 漏洞优先级分诊","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","使用 CISA 的 Stakeholder-Specific Vulnerability Categorization（SSVC，利益相关方特定漏洞分类）决策树对漏洞进行分诊和优先级排序，权衡利用状态（通过 CISA KEV 目录和 FIRST EPSS API）、技术影响、自动化程度和任务普遍性，输出 Track\u002FTrack*\u002FAttend\u002FAct 决策。适用于对漏洞扫描结果（OpenVAS、Nessus、Qualys）进行优先级排序以制定修复计划，而不局限于原始 CVSS 分数的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[232,235],{"categoryNo":233,"categoryName":234,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQV98CYQ7TEW2D1MRQ00TE","安全公告与漏洞管理",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[237,238,239,34,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"vulnerabilities","framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","api","prioritization","ssvc","decision-tree",{"skillNo":257,"name":258,"nameZh":259,"description":260,"descriptionZh":261,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":262,"categories":263,"keywords":268,"publishedAt":47},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","安全事件初步分诊","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","使用 NIST SP 800-61r3 和 SANS PICERL 框架对安全事件进行初步分诊，分类事件类型、按业务影响分配优先级，并路由到相应的响应团队。适用于 SIEM\u002FEDR 告警需要人工分类、并发告警必须确定优先级，或用户报告或威胁情报 IOC 匹配需要初步事件分类的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[264,265],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":266,"categoryName":267,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTHYSJPJ500X64JJ5CH06D","安全事件响应与威胁狩猎",[33,269,34,270,271,272,273,274,275,276,277,188,278,189,279,280,281,282,283,284],"triaging security incident","siem","file","ioc","soc","NIST-800-61","NIST","severity","edr","execution","analysis","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]