SKY-SCA-SRC004 · Supply chain and agent configuration
Package moved to a source this repository did not use
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/mainon 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
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
{ "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
{ "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
- Runs with
--scawhen the scan has a diff base (--diffor--diff-base). It reads both sides of every changed lockfile as data and never installs anything. - 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.
- 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.
- Names are compared across every lockfile on the base branch, so moving a lockfile to another folder is not a new source.
- A package matching
internal_packagesunder[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.
{ "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_packageson the target branch. - A package moved between private indexes in
uv.lock,poetry.lockorPipfile.lockis 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.