SKY-D360 · CI/CD pipelines
Dependabot runs manifest code with registry credentials
Some package formats run code to work out their dependencies, for example a Python setup.py. Dependabot does not run that code unless an update entry sets insecure-external-code-execution: allow. SKY-D360 reports that setting on a pip, bundler or mix entry that also logs in to private registries.
- Languages
- Dependabot configuration
- Quality gate
- counted toward the gate limits (full and diff scans)
- Finding type
- review
- Catalog name
- Dependabot insecure external code execution
Why it matters
With the option on, code from your manifests and from the packages they pull in runs inside Dependabot's job, which holds the private registry passwords you gave it. A typosquatted or hijacked dependency can read those credentials and use them to publish to your internal index.
What Skylos flags
version: 2registries: acme-pypi: type: python-index url: https://pypi.acme.example/simple username: dependabot password: ${{ secrets.ACME_PYPI_PASSWORD }}updates: - package-ecosystem: pip directory: / registries: - acme-pypi insecure-external-code-execution: allow schedule: interval: weekly cooldown: default-days: 7What Skylos leaves alone
version: 2updates: - package-ecosystem: pip directory: /tools/legacy-plugin insecure-external-code-execution: allow schedule: interval: weekly cooldown: default-days: 7Why Skylos leaves it alone
The option is set, but this entry uses no private registry, so the manifest code runs without any credentials to steal. Skylos reports the option only together with registries.
How Skylos decides
- Reads the one file GitHub reads:
.github/dependabot.yml(or.yaml) at the top of the scanned folder. Copies elsewhere are ignored. The file must sayversion: 2and have anupdateslist. - For each
updatesentry, checksinsecure-external-code-execution. Only the valueallow(any case) counts. - Reports the entry when its
package-ecosystemispip,bundlerormix, the ecosystems where Dependabot can run manifest code, and the entry listsregistries. - One HIGH finding per entry, on the line of the option.
How to fix it
Remove the option. Dependabot then updates the manifest without running its code. If a package really needs code to resolve, publish a built wheel of it to your index instead.
version: 2registries: acme-pypi: type: python-index url: https://pypi.acme.example/simple username: dependabot password: ${{ secrets.ACME_PYPI_PASSWORD }}updates: - package-ecosystem: pip directory: / registries: - acme-pypiRemoved: insecure-external-code-execution: allow schedule: interval: weekly cooldown: default-days: 7When it can be wrong
- Not reported: the option on an entry without
registries, even though the manifest code still runs there. - The finding does not depend on which registry is listed; a registry with read-only credentials is reported the same as one that can publish.
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
Put
# skylos: ignore[SKY-D360]and a reason as a YAML comment at the end of the reported line, or as a comment line directly above it. Text inside a value does not count.YAML # skylos: ignore[SKY-D360] read-only mirror token, setup.py vendoredinsecure-external-code-execution: allow[tool.skylos] ignore = ["SKY-D360"]turns the rule off for the whole project.