Summary
Beta9's image build process runs tenant-defined shell commands with Buildah using chroot isolation, which changes the filesystem root without separating key process, network, IPC, or user namespaces. A tenant with a workspace token who submits an image build may therefore gain access to sensitive resources in the privileged worker pod, including its service account token and worker binaries.
Affected context
The issue affects Beta9 worker pods that execute tenant image builds with Buildah in chroot isolation. In this configuration, build steps share important namespaces with the worker and run as uid 0 with CAP_DAC_OVERRIDE. The worker filesystem is accessible through the shared procfs, and may contain credentials, container runtime binaries, and directories mounted into the pod.
Exploit preconditions
- Attack surface: Tenant image-build workflow using the worker's Buildah process
- Required access: A valid workspace token with permission to submit an image build
- Trigger point: Execution of a tenant-defined shell command during a build
- Why exploitation is possible: Chroot isolation changes the build step's filesystem root but does not provide private PID, network, IPC, and user namespaces. The step runs with elevated privileges in the worker's shared namespace context.
Why this happens
The underlying issue is insufficient compartmentalization (CWE-653): the build environment does not adequately isolate tenant-controlled commands from the worker. Running Buildah with chroot isolation limits filesystem view but does not create the namespace boundaries needed to separate processes and resources. The build step also runs as uid 0 with CAP_DAC_OVERRIDE, reflecting a privilege-management concern (CWE-269) that increases the consequences of the isolation failure.
Potential impact
- A tenant-controlled build step may access or modify files in the worker container.
- Worker binaries used to start tenant containers could be exposed to tampering.
- The worker's Kubernetes service account token could be accessed, potentially enabling actions within the permissions granted to that identity.
- Host directories mounted into the worker pod may be exposed or modified, depending on their contents and permissions.
- The worker pod and other workloads it can reach may be compromised.
General mitigation guidance
Defensive designs typically isolate tenant-controlled build commands with private namespaces and a build environment that is separate from the worker's runtime and credentials. Prefer secure-by-default isolation modes that separate process, network, IPC, and user namespaces rather than relying on filesystem-root changes alone.
Reduce the privileges available to build steps, avoid exposing worker credentials and runtime binaries to the build environment, and limit mounted host resources. Treat tenant-provided commands and build arguments as untrusted; pass them only into the isolated build container and validate configuration at trust boundaries.
How teams detect issues like this
Review build execution paths for isolation settings that change only the filesystem root, and check whether tenant-controlled commands share namespaces, credentials, or writable filesystems with the worker. Static analysis and code review can flag Buildah invocations that omit explicit isolation settings, privileged execution, or broad capabilities.
Runtime policies can enforce private namespaces, restrict capabilities and privileged pods, and prevent build containers from mounting worker or host resources. Audit build-worker access to service account tokens and monitor for unexpected changes to container runtime binaries.

