CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-W7J5-J98M-W679
8.5 (Estimated)

GHSA-W7J5-J98M-W679: Excessive Privileges (Root Execution) in OpenClaw Containers

Alon Barad
Alon Barad
Software Engineer

Mar 4, 2026·6 min read·2 visits

PoC Available

Executive Summary (TL;DR)

OpenClaw Docker containers run as root (UID 0) by default. If an attacker gains Remote Code Execution (RCE) via the AI assistant, they immediately possess root access within the container, facilitating system modification and potential host escape. Fixed in recent updates by introducing a non-root 'sandbox' user.

OpenClaw, a popular open-source AI assistant, was found to execute critical containerized processes with full root privileges. This configuration violates the principle of least privilege and significantly lowers the barrier for attackers to achieve persistence or container escape following a compromise. The vulnerability affects multiple Dockerfiles used for end-to-end testing and sandboxing.

Vulnerability Overview

OpenClaw is an open-source personal AI assistant capable of executing tasks and managing workflows. To perform these tasks securely, it relies on containerized environments (Docker) for sandboxing and end-to-end (E2E) testing. However, a security audit revealed that multiple Dockerfiles within the project's repository were configured to execute processes as the root user (UID 0) by default.

This configuration represents a critical violation of the principle of least privilege (CWE-250). In a properly hardened container environment, applications should run as a dedicated, unprivileged user to limit the blast radius of a potential compromise. By running as root, the OpenClaw application removes standard operating system barriers that would otherwise contain an attacker.

The affected components include Dockerfile.sandbox, Dockerfile.sandbox-browser, and several testing configurations in the scripts/e2e directory. These environments are often used to execute untrusted code or parse complex inputs, making them high-value targets for exploitation.

Root Cause Analysis

The root cause of this vulnerability is the omission of the USER instruction in the project's Dockerfiles. By design, Docker containers execute processes as root unless a specific user is created and selected. This default behavior prioritizes developer convenience over security, requiring explicit intervention to harden.

In the vulnerable versions of OpenClaw, the base images (derived from node:22-bookworm) were used without defining a non-privileged user context. Consequently, the ENTRYPOINT and CMD instructions executed the AI assistant's core logic with full administrative permissions inside the container namespace.

Furthermore, the issue was compounded by file permission management. During the build process, files were copied into the image while the context was root. This resulted in the application files being owned by root, which historically discouraged developers from switching users, as a non-root user would lack permission to modify logs or configuration files created during the build steps.

Code Analysis

The following analysis compares the vulnerable Docker configuration with the hardened version introduced in the patch. The key difference lies in the explicit creation of a service user and the reassignment of process ownership.

Vulnerable Configuration (Before Patch):

The original Dockerfile.sandbox lacked any user management instructions. The Node.js application started implicitly as UID 0.

# Dockerfile.sandbox (Vulnerable)
FROM node:22-bookworm
 
WORKDIR /app
COPY . .
 
# Application runs as ROOT by default here
CMD ["npm", "run", "start:sandbox"]

Patched Configuration (After Patch):

The fix, applied in commit 28e1a65ebc580f07533966f5693f4df0a18d7085, introduces a dedicated sandbox user. It creates the user, ensures the home directory exists, and explicitly switches the context before the application starts.

# Dockerfile.sandbox (Fixed)
FROM node:22-bookworm
 
# 1. Create a non-root user
RUN useradd --create-home --shell /bin/bash sandbox
 
WORKDIR /home/sandbox
COPY . .
 
# 2. Switch context to the non-root user
USER sandbox
 
# Application now runs as 'sandbox' (non-root)
CMD ["npm", "run", "start:sandbox"]

> [!NOTE] > While the main sandbox files were patched, researchers noted that some E2E testing Dockerfiles (e.g., scripts/e2e/Dockerfile) may still require manual verification to ensure they have also been updated.

Exploitation Methodology

Exploitation of this vulnerability typically follows a post-compromise trajectory. An attacker must first achieve code execution within the container, likely through a separate vulnerability such as a malicious AI skill, a dependency confusion attack, or command injection via untrusted input.

Once code execution is achieved, the impact of the root privilege becomes immediate. In a standard attack flow against a non-root container, the attacker would first need to escalate privileges (PE) to gain full control. In OpenClaw's vulnerable configuration, this step is bypassed entirely.

Attack Flow:

  1. Initial Access: The attacker exploits an RCE vulnerability in the OpenClaw assistant (e.g., via a malicious plugin).
  2. Privilege Verification: The attacker executes id and receives uid=0(root) gid=0(root).
  3. Persistence: With root access, the attacker can modify system binaries, install rootkits, or alter the container's startup scripts to ensure their payload runs every time the container restarts.
  4. Escape Attempts: The attacker leverages the root privileges to interact with the kernel. Techniques such as mounting the host filesystem (if capabilities allow) or exploiting kernel vulnerabilities (like Dirty Pipe or similar) become significantly more feasible from a root context.

Impact Assessment

The security impact of running as root is high, specifically affecting the confidentiality and integrity of the containerized environment. While the vulnerability exists within a container, it significantly weakens the isolation boundary between the application and the host kernel.

Key Impacts:

  • Privilege Escalation: Attackers start with the highest possible privileges inside the container, eliminating the need for local privilege escalation exploits.
  • Container Escape Risk: Root access is a prerequisite for many container escape techniques (T1611). It allows interaction with the /proc and /sys filesystems in ways that unprivileged users cannot.
  • Data Integrity: An attacker can modify any file within the container, including application code, configuration, and secrets, without restriction.

Estimated CVSS v3.1 Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H (Score: ~8.5-9.0). The Scope (S) is marked as Changed (C) because root privileges inside a container can lead to impacts on the underlying host or other containers in the same network.

Remediation & Mitigation

The primary remediation is to update OpenClaw to the latest version, which includes the Dockerfile patches. Administrators should verify that their deployment images are built from the patched Dockerfiles which include the USER sandbox directive.

Immediate Mitigation Strategies:

  1. Runtime User Enforcement: If upgrading the image is not immediately possible, force the container to run as a non-root user at runtime.
    • Docker: Use the --user flag: docker run --user 1000:1000 openclaw/image.
    • Kubernetes: Set the securityContext: runAsUser: 1000 and runAsNonRoot: true.
  2. Filesystem Hardening: Ensure that the application runs with a Read-Only Root Filesystem (--read-only) wherever possible, mounting writable volumes only for specific directories that require it (e.g., /tmp or log directories).
  3. Capability Dropping: Explicitly drop dangerous Linux capabilities using --cap-drop=ALL and only add back strictly necessary ones. This limits what even a root user can do inside the container.

Official Patches

OpenClawFix commit implementing sandbox user

Fix Analysis (1)

Technical Appendix

CVSS Score
8.5 (Estimated)/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Affected Systems

OpenClaw (npm package)OpenClaw Docker Images

Affected Versions Detail

Product
Affected Versions
Fixed Version
OpenClaw
OpenClaw
< Feb 2026 Hygiene PatchCommit 28e1a65
AttributeDetail
CWE IDCWE-250
CWE NameExecution with Unnecessary Privileges
CVSS (Est.)8.5 (High)
Attack VectorNetwork / Local
Privileges RequiredNone
Exploit StatusPoC Available

MITRE ATT&CK Mapping

T1610Deploy Container
Defense Evasion
T1611Escape to Host
Privilege Escalation
T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-250
Execution with Unnecessary Privileges

The software performs an operation at a privilege level that is higher than the minimum level required, increasing the potential for damage.

Known Exploits & Detection

Medium (Rafael Martinez)Self-audit PoC where the assistant identifies itself running as root

Vulnerability Timeline

Partial fix commit 28e1a65 submitted
2026-02-08
Detailed audit published by Rafael Martinez
2026-02-21
GHSA-W7J5-J98M-W679 published
2026-02-22

References & Sources

  • [1]GHSA-W7J5-J98M-W679 Advisory
  • [2]Security Audit by Terminals & Coffee

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.