AgentbeamBeta
AI agent vulnerability · OpenClaw

GHSA-w7j5-j98m-w679: OpenClaw has multiple E2E/test Dockerfiles that run all processes as root

highCVSS 4.0 8.4

Several OpenClaw end-to-end test Dockerfiles have no USER directive, so every process in a container built from them runs as root. Versions up to 2026.2.19-2 are listed as affected and 2026.2.21 as patched. The risk is limited to people who build and run these test images. The advisory rates it high.

Published Mar 3, 2026 · Analysis Nov 7, 2026

What an attacker can do

The Dockerfiles scripts/e2e/Dockerfile, scripts/e2e/Dockerfile.qr-import and scripts/docker/install-sh-e2e/Dockerfile set no USER, so processes run as uid 0. A fourth, scripts/docker/install-sh-nonroot/Dockerfile, runs as a non-root user but grants passwordless sudo, which a related advisory covers. The weakness is CWE-250, execution with unnecessary privileges.

This is not a remote bug in the OpenClaw runtime. A container built from one of these images must be running, and something inside it must already be compromised. Then root inside the container makes kernel exploit attempts, volume mount abuse and privileged syscalls easier. You can see the problem by running id in the container and getting uid=0(root).

The test images share the base image node:22-bookworm with production, so a root test image could be deployed by accident.

The repo had already added a USER directive to Dockerfile.sandbox and Dockerfile.sandbox-browser in commit 28e1a65. The E2E images were missed.

Who is affected

The npm package openclaw up to 2026.2.19-2. Only teams that build these Dockerfiles from the repository are exposed; a normal npm install is not. Check by running a test image.

docker run --rm <image> id

Output of uid=0(root) confirms the issue.

openclaw

Ecosystem
npm
Affected
< 2026.2.21
Fixed in
2026.2.21
Check
npm ls openclaw

How to fix it

Upgrade to OpenClaw 2026.2.21 or later and rebuild any test images from it. The advisory's suggested fix is to add a non-root user and switch to it before CMD or ENTRYPOINT, for example RUN useradd --create-home --shell /bin/bash appuser followed by USER appuser. If you cannot upgrade, apply that change in your own copies of the Dockerfiles and do not deploy test images.

How to tell if you were hit

List images and running containers built from the E2E Dockerfiles and run id inside them. Check your registry and deployment manifests for any test image tags that reached a non-test environment. Review container logs for unexpected processes launched as root.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Three Dockerfiles in scripts/docker/ and scripts/e2e/ lack a USER directive, meaning all processes run as uid 0 (root). If any process is compromised, the attacker has root inside the container, making container breakout significantly easier. Partial fix (2026-02-08): Commit 28e1a65e added USER sandbox to Dockerfile.sandbox and Dockerfile.sandbox-browser. The E2E/test Dockerfiles listed below remain unpatched.

Affected components:

  • scripts/e2e/Dockerfile
  • scripts/e2e/Dockerfile.qr-import
  • scripts/docker/install-sh-e2e/Dockerfile
  • scripts/docker/install-sh-nonroot/Dockerfile (runs as app but with NOPASSWD sudo — see related advisory)

Technical Reproduction:

  1. Open each Dockerfile listed above and search for a USER directive — none found.
  2. Run any of these containers: docker run --rm -it id
  3. Observe: returns uid=0(root).

Demonstrated Impact:

  • Root inside the container enables kernel exploit attempts, volume mount abuse, and privileged syscall access.
  • Test images share the same base (node:22-bookworm) as production, creating risk of accidental deployment of root-running images.

Environment: Base images node:22-bookworm and node:22-bookworm-slim default to root. Dockerfile.sandbox and Dockerfile.sandbox-browser were remediated in commit 28e1a65e; only the E2E/test images listed above remain affected.

Remediation: Add a USER directive before CMD/ENTRYPOINT in each remaining Dockerfile: RUN useradd --create-home --shell /bin/bash appuser USER appuser

Credited to TerminalsandCoffee.

Questions

Does GHSA-w7j5-j98m-w679 affect a normal OpenClaw install?

No. It concerns the repository's E2E and test Dockerfiles. You are exposed only if you build and run those images.

Is this remotely exploitable?

Not by itself. A process in the container must already be compromised. Root then raises the damage that process can do.

What version has the fix?

OpenClaw 2026.2.21 or later. Versions up to 2026.2.19-2 are listed as affected.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More OpenClaw vulnerabilities

All OpenClaw entries