Skip to main content

SKY-SCA-SRC001 · Supply chain and agent configuration

Possible dependency confusion

Critical

CRITICAL for a direct dependency, HIGH for a transitive one (a package that another dependency pulls in).

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_packages under [tool.skylos.supply_chain]; without it the rule does not run.
Finding type
review
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

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

requirements.txt · TextReported on line 2
--extra-index-url https://pypi.acme.example/simpleacme-billing==2.0.0six==1.17.0
pyproject.toml · TOML
[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

requirements.txt · Text
--index-url https://pypi.acme.example/simpleacme-billing==2.0.0six==1.17.0

pyproject.toml: same as in the flagged example.

Why 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

package-lock.json · JSONReported on line 16
{  "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="    }  }}
pyproject.toml · TOML
[tool.skylos.supply_chain]internal_packages = ["@acme/*"]private_registries = ["https://npm.acme.example"]

Not flagged

package-lock.json · JSON
{  "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="    }  }}

pyproject.toml: same as in the flagged example.

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

  1. Runs with --sca, and only when internal_packages under [tool.skylos.supply_chain] lists name patterns such as acme-* or @acme/*. In pull-request CI the policy is read from the base commit, so a pull request cannot change it for itself.
  2. Skylos reads manifests and lockfiles itself, records which registry each npm and PyPI package comes from (the --index-url and --extra-index-url lines of a requirements file, or the registry a lockfile records), and hands the packages and the policy to the ca9 library, which decides the finding.
  3. 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.
  4. Skylos keeps a ca9 finding 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.

requirements.txt · Text · the fix, against the flagged file
Removed: --extra-index-url https://pypi.acme.example/simpleAdded: --index-url https://pypi.acme.example/simpleacme-billing==2.0.0six==1.17.0

When it can be wrong

  • Without private_registries, Skylos cannot tell your index is private, so even an exclusive --index-url to it is reported. List every private index in private_registries.
  • A requirements file that names no index is not reported, even for an internal name, because pip may take its index from pip.conf or PIP_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 from internal_packages.

    TOML
    [tool.skylos]ignore = ["SKY-SCA-SRC001"]
  • A baseline does not hold it: dependency baselines (skylos baseline . --sca) save only known vulnerabilities.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.