SKY-SCA-SRC001 · Supply chain and agent configuration
Possible dependency confusion
Dependency confusion is an attack on private package names: someone publishes a package with the same name as your internal one on the public registry, and the installer picks it up. SKY-SCA-SRC001 reports a package that matches your internal name patterns but can be installed from a registry that is not one of your private ones.
- Languages
- requirements*.txt, pyproject.toml, uv.lock, poetry.lock, Pipfile.lock, package.json, npm, pnpm, Yarn and Bun lockfiles
- Quality gate
- counted toward the gate limits (full and diff scans). Counts toward
max_dependency_vulnerabilities, which is 0 by default, so one finding fails--gate. - Needs
internal_packagesunder[tool.skylos.supply_chain]; without it the rule does not run.- Finding type
- review
Why it matters
The attacker's package runs its install script on developer machines and CI runners as soon as it is installed. With pip's --extra-index-url, pip looks at the public index too and takes the highest version, so a public acme-billing 99.0.0 wins over your private 2.0.0.
What Skylos flags
--extra-index-url https://pypi.acme.example/simpleacme-billing==2.0.0six==1.17.0[project]name = "shop"version = "1.0.0" [tool.skylos.supply_chain]internal_packages = ["acme-*"]private_registries = ["https://pypi.acme.example/simple"]What Skylos leaves alone
--index-url https://pypi.acme.example/simpleacme-billing==2.0.0six==1.17.0Why Skylos leaves it alone
The same internal package from the same private index, but --index-url makes that index the only one pip reads (the index is expected to mirror public packages such as six). Nobody can slip a public acme-billing in front of it.
More languages
JSON
Flagged
{ "name": "shop", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shop", "version": "1.0.0", "dependencies": { "@acme/billing": "2.0.0", "ms": "2.1.3" } }, "node_modules/@acme/billing": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@acme/billing/-/billing-2.0.0.tgz", "integrity": "sha256-9mFuFeUw7VUvnaotPOcZY5R8a8fJjJtk/T5nP9AmIsY=" }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha256-9mFuFeUw7VUvnaotPOcZY5R8a8fJjJtk/T5nP9AmIsY=" } }}[tool.skylos.supply_chain]internal_packages = ["@acme/*"]private_registries = ["https://npm.acme.example"]Not flagged
{ "name": "shop", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "shop", "version": "1.0.0", "dependencies": { "@acme/billing": "2.0.0", "ms": "2.1.3" } }, "node_modules/@acme/billing": { "version": "2.0.0", "resolved": "https://npm.acme.example/@acme/billing/-/billing-2.0.0.tgz", "integrity": "sha256-9mFuFeUw7VUvnaotPOcZY5R8a8fJjJtk/T5nP9AmIsY=" }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha256-9mFuFeUw7VUvnaotPOcZY5R8a8fJjJtk/T5nP9AmIsY=" } }}Why Skylos leaves it alone
The lockfile resolves @acme/billing from the declared private registry. In the flagged lockfile it came from the public npm registry, where anyone could have registered the @acme scope.
How Skylos decides
- Runs with
--sca, and only wheninternal_packagesunder[tool.skylos.supply_chain]lists name patterns such asacme-*or@acme/*. In pull-request CI the policy is read from the base commit, so a pull request cannot change it for itself. - Skylos reads manifests and lockfiles itself, records which registry each npm and PyPI package comes from (the
--index-urland--extra-index-urllines of a requirements file, or the registry a lockfile records), and hands the packages and the policy to theca9library, which decides the finding. - A package matching a pattern is reported when its registry is not in
private_registries, or when pip merges a private extra index with the public one. - Skylos keeps a
ca9finding only when it knows the package's registry (or that indexes are merged) and the policy has patterns, so a looser engine cannot report confusion without evidence.
How to fix it
Install internal packages only from your private registry: an exclusive --index-url (or [[tool.uv.index]] with explicit = true) in Python, and a scoped registry such as @acme:registry=https://npm.acme.example in .npmrc for npm. Also register your names or scope on the public registry so nobody else can.
Removed: --extra-index-url https://pypi.acme.example/simpleAdded: --index-url https://pypi.acme.example/simpleacme-billing==2.0.0six==1.17.0When it can be wrong
- Without
private_registries, Skylos cannot tell your index is private, so even an exclusive--index-urlto it is reported. List every private index inprivate_registries. - A requirements file that names no index is not reported, even for an internal name, because pip may take its index from
pip.conforPIP_INDEX_URL, which Skylos does not read. - A public package that happens to match a broad pattern such as
acme*is reported when it comes from the public registry. Make the patterns as narrow as your naming allows.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
An inline marker on the requirement line is not read: the finding stays reported.
Text acme-billing==2.0.0 # skylos: ignore[SKY-SCA-SRC001][tool.skylos] ignore = ["SKY-SCA-SRC001"]does not hide it in a full scan. To stop checking a name, remove its pattern frominternal_packages.TOML [tool.skylos]ignore = ["SKY-SCA-SRC001"]A baseline does not hold it: dependency baselines (
skylos baseline . --sca) save only known vulnerabilities.