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

> OpenClaw test Dockerfiles run as root, allowing attackers to gain root privileges inside the container if a process is compromised.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Mar 2026

## What is GHSA-w7j5-j98m-w679?

GHSA-w7j5-j98m-w679 is a vulnerability in openclaw, published on 3 Mar 2026. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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 <image> 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

## Which versions are affected by GHSA-w7j5-j98m-w679?

2 open source packages ship an affected version, including openclaw.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openclaw` | npm | All versions | 2026.2.21 |
| `openclaw` | npm | All versions | 2026.2.21 |

## How do I fix GHSA-w7j5-j98m-w679?

Upgrade openclaw to 2026.2.21 or later.

## Is GHSA-w7j5-j98m-w679 being exploited?

There is no known exploitation of GHSA-w7j5-j98m-w679 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-w7j5-j98m-w679 and fix it if it is affected.

What it is: GHSA-w7j5-j98m-w679 is a vulnerability in openclaw, published on 3 Mar 2026. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-w7j5-j98m-w679 in the wild and no public exploit code.

Affected packages and fixed versions:
- openclaw (npm): affected all versions; fixed in 2026.2.21
- openclaw (npm): affected all versions; fixed in 2026.2.21

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-w7j5-j98m-w679/ (Markdown: https://insights.sbomify.com/GHSA-w7j5-j98m-w679/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-w7j5-j98m-w679

---
From sbomify Insights: https://insights.sbomify.com/GHSA-w7j5-j98m-w679/
Summaries are generated and may contain mistakes; the official description above is the record.
