T08 · Insecure Dependencies
- Location
scripts/docker_buildx_init.sh:19- Finding
Unpinned External Container Executes with Privileged Host Access
- Content
View full analysis
Vulnerability Details
File Location:
scripts/docker_buildx_init.sh, lines 19–20
Vulnerability Type:T08: Insecure Dependencies
Risk Level: HighComplete Code Snippet:
bash # Register cross-platform emulators for multi-architecture builds docker run --privileged --rm tonistiigi/binfmt:latest --install allTechnical Analysis
The initialization script executes the external
tonistiigi/binfmtcontainer using both the mutablelatesttag and Docker's unrestricted--privilegedmode. The dependency is not pinned to a reviewed, immutable image digest. Consequently, the image content executed during a future invocation can differ from the content reviewed during this audit.Registering binfmt handlers is related to the declared multi-architecture build functionality, but the combination of a mutable dependency and privileged execution creates a high-impact supply-chain trust boundary. If the upstream image, publishing account, registry path, or mutable tag is compromised, attacker-controlled code would execute with extensive access to host kernel interfaces and devices.
The
--rmoption only removes the container after execution. It neither constrains its privileges nor reverses changes that it makes to the host while running.Attack Path
- An attacker compromises the upstream image publisher, registry repository, publishing credentials, or the content referenced by
tonistiigi/binfmt:latest. - The attacker publishes a malicious replacement under the same mutable
latesttag. - A user invokes the Build Init workflow, or the Build and Push workflow that calls Build Init.
- Docker resolves and runs the attacker-controlled image without verifying a fixed digest.
- The malicious container executes under
--privileged, accesses host-exposed kernel and device interfaces, and makes unauthorized host changes. - Container removal does not undo host modifications, credential access, ...[truncated 720 chars]
- An attacker compromises the upstream image publisher, registry repository, publishing credentials, or the content referenced by
- Remediation
View remediation
Remediation Suggestions
-
Replace the mutable tag with a reviewed immutable digest:
bash docker run --privileged --rm \ tonistiigi/binfmt@sha256:REVIEWED_IMMUTABLE_DIGEST \ --install all -
Establish a controlled dependency-update process that verifies the image's publisher, digest, provenance, signatures, and release notes before changing the pinned digest.
-
Enforce signature or provenance verification through the deployment environment where supported.
-
Prefer configuring emulation once through trusted host provisioning rather than downloading and executing a privileged container during every Skill invocation.
-
If runtime registration remains necessary, request explicit user approval immediately before privileged execution and clearly disclose that it modifies host-level binfmt configuration.
-
Reduce privileges where technically possible, limit the installed emulators to the architectures actually requested, and isolate this operation on a dedicated build host with no unrelated workloads or sensitive credentials.
-
Configure registry allowlists or an approved internal mirror so the privileged image can only originate from a controlled source.
-
