← Voltar ao feed
low

SafeDep PMG gap: Docker builds on self-hosted CI runners skip malicious package checks; PMG_CONTAINER_TRUST=1 closes it

1 fonte(s) · 1 atualização(ões) · publicado 25/11/2026 21:00 · coletado há 1 semana

SafeDep reports that its PMG package manager guard, when running on self-hosted CI runners where the Docker daemon runs inside the runner container (e.g. summerwind Actions Runner Controller (ARC)), checks only the packages that a job step installs. Installs inside docker build, docker run and job containers skip that check by default, so a malicious package installs and the build passes. In a lab run, the test packages safedep-test-pkg (npm 0.1.3, pip 0.0.4) installed in those places when the switch was off. With PMG_CONTAINER_TRUST=1, each place returned a 403 for the malicious package and normal packages (is-number, six) still installed. This is a vendor-published hardening guide with lab results, not an in-the-wild incident. The test package is benign.

Detalhes técnicos

  • PMG attaches eBPF programs to the runner container's cgroup. The Docker daemon starts containers in another cgroup and network namespace, so their traffic bypasses PMG.
  • With a forward proxy (e.g. Squid) in the runner container, PMG intercepts the proxy's registry connections and presents its own CA. The containers do not trust that CA, so even normal installs fail with UNABLE_TO_VERIFY_LEAF_SIGNATURE.
  • The switch enables the container redirect and installs pmg-runc, an OCI runtime wrapper. It is linked at /usr/local/sbin/runc and edits each container's config.json. It mounts the PMG CA read-only in /dev/pmg-ca and sets NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, REQUESTS_CA_BUNDLE, PIP_CERT and UV_NATIVE_TLS. It refuses files that hold private keys.
  • Known limits: host-network containers get no check. Containers started with -v /dev:/dev, or by a docker:dind container, get no CA. Java, GnuTLS wget and Bun 1.2 ignore the CA variables. A Docker daemon in a sidecar (DOCKER_HOST set) is unsupported. A proxy on the Docker bridge sees runner traffic from 169.254.200.1.
  • The lab used Docker 28.0.4, runner 2.338.2 and Node.js 22.23.5. It ran PMG commit 472e1f9 (PR #638) before any release.

Remediação

  • Use PMG v0.37.0 or later, on Linux 5.15+ with kernel BTF and cgroup v2.
  • Build the runner image from the ARC runners guide. It uses the PMG entrypoint on summerwind/actions-runner-dind.
  • Set PMG_CONTAINER_TRUST=1 on the runner container, and test with safedep-test-pkg. A passing step means the containers get no PMG check.

Linha do tempo

  1. safedep.io ↗ · pub. 25/11/2026 21:00 · coletado 27/11 17:00 primeiro registro

    SafeDep PMG gap: Docker builds on self-hosted CI runners skip malicious package checks; PMG_CONTAINER_TRUST=1 closes it

    ler a análise desta fonte

    SafeDep reports that its PMG package manager guard, when running on self-hosted CI runners where the Docker daemon runs inside the runner container (e.g. summerwind Actions Runner Controller (ARC)), checks only the packages that a job step installs. Installs inside docker build, docker run and job containers skip that check by default, so a malicious package installs and the build passes. In a lab run, the test packages safedep-test-pkg (npm 0.1.3, pip 0.0.4) installed in those places when the switch was off. With PMG_CONTAINER_TRUST=1, each place returned a 403 for the malicious package and normal packages (is-number, six) still installed. This is a vendor-published hardening guide with lab results, not an in-the-wild incident. The test package is benign.

    Technical Details

    • PMG attaches eBPF programs to the runner container's cgroup. The Docker daemon starts containers in another cgroup and network namespace, so their traffic bypasses PMG.
    • With a forward proxy (e.g. Squid) in the runner container, PMG intercepts the proxy's registry connections and presents its own CA. The containers do not trust that CA, so even normal installs fail with UNABLE_TO_VERIFY_LEAF_SIGNATURE.
    • The switch enables the container redirect and installs pmg-runc, an OCI runtime wrapper. It is linked at /usr/local/sbin/runc and edits each container's config.json. It mounts the PMG CA read-only in /dev/pmg-ca and sets NODE_EXTRA_CA_CERTS, SSL_CERT_FILE, REQUESTS_CA_BUNDLE, PIP_CERT and UV_NATIVE_TLS. It refuses files that hold private keys.
    • Known limits: host-network containers get no check. Containers started with -v /dev:/dev, or by a docker:dind container, get no CA. Java, GnuTLS wget and Bun 1.2 ignore the CA variables. A Docker daemon in a sidecar (DOCKER_HOST set) is unsupported. A proxy on the Docker bridge sees runner traffic from 169.254.200.1.
    • The lab used Docker 28.0.4, runner 2.338.2 and Node.js 22.23.5. It ran PMG commit 472e1f9 (PR #638) before any release.

    Remediation

    • Use PMG v0.37.0 or later, on Linux 5.15+ with kernel BTF and cgroup v2.
    • Build the runner image from the ARC runners guide. It uses the PMG entrypoint on summerwind/actions-runner-dind.
    • Set PMG_CONTAINER_TRUST=1 on the runner container, and test with safedep-test-pkg. A passing step means the containers get no PMG check.