Skip to main content

SKY-D360 · CI/CD pipelines

Dependabot runs manifest code with registry credentials

High

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
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

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

.github/dependabot.yml · YAMLReported on line 13
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: 7

What Skylos leaves alone

.github/dependabot.yml · YAML
version: 2updates:  - package-ecosystem: pip    directory: /tools/legacy-plugin    insecure-external-code-execution: allow    schedule:      interval: weekly    cooldown:      default-days: 7

Why 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

  1. 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 say version: 2 and have an updates list.
  2. For each updates entry, checks insecure-external-code-execution. Only the value allow (any case) counts.
  3. Reports the entry when its package-ecosystem is pip, bundler or mix, the ecosystems where Dependabot can run manifest code, and the entry lists registries.
  4. 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.

.github/dependabot.yml · YAML · the fix, against the flagged file
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: 7

When 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.

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