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-HXVM-XJVF-93F3

GHSA-HXVM-XJVF-93F3: Arbitrary Code Execution via Insecure Environment Variable Loading in OpenClaw

Amit Schendel
Amit Schendel
Senior Security Researcher

Apr 26, 2026·4 min read·37 visits

Executive Summary (TL;DR)

Untrusted workspace `.env` files can override OpenClaw internal variables, leading to arbitrary code execution. Users must upgrade to version 2026.4.20.

OpenClaw versions prior to 2026.4.20 are vulnerable to arbitrary code execution due to insecure handling of workspace-local `.env` files. The application fails to restrict the entire `OPENCLAW_` namespace, allowing untrusted repositories to override critical internal control variables.

Vulnerability Overview

OpenClaw is an AI-driven personal assistant and coding tool distributed via the npm package registry. The application supports loading workspace-specific configuration data through local .env files. This functionality allows users to customize runtime behavior on a per-project basis.

A vulnerability exists in OpenClaw versions prior to 2026.4.20 regarding the validation of these environment variables. The application fails to adequately sanitize the runtime environment when loading variables from an untrusted workspace.

Attackers can exploit this flaw by supplying a malicious repository containing a crafted .env file. When a user opens the repository with OpenClaw, the application applies the attacker-controlled variables. This configuration override facilitates arbitrary code execution within the context of the user running OpenClaw.

Root Cause Analysis

The root cause resides in the environment variable loading implementation located within src/infra/dotenv.ts. The application implements a security control to prevent untrusted workspaces from modifying sensitive configuration values. This control relies on a denylist of variable prefixes defined in the BLOCKED_WORKSPACE_DOTENV_PREFIXES array.

The original implementation successfully blocked specific sub-namespaces, such as OPENCLAW_CLAWHUB_, OPENCLAW_DISABLE_, and OPENCLAW_SKIP_. However, the logic omitted the generic OPENCLAW_ prefix from the denylist. This omission created a validation bypass for any variable beginning with OPENCLAW_ that did not match the explicitly blocked sub-strings.

Consequently, an untrusted workspace .env file could define arbitrary internal control variables. The application would import these variables into its runtime configuration, granting external control over internal application states. This oversight effectively allowed attackers to manipulate paths, API endpoints, and execution hooks utilized by OpenClaw.

Code Analysis

The vulnerability is evident in the configuration of the BLOCKED_WORKSPACE_DOTENV_PREFIXES array prior to version 2026.4.20. The array specified explicit variable strings to reject during the .env loading process.

// src/infra/dotenv.ts (Vulnerable Implementation)
const BLOCKED_WORKSPACE_DOTENV_PREFIXES = [
  "ANTHROPIC_API_KEY_",
  "CLAWHUB_",
  "OPENAI_API_KEY_",
  "OPENCLAW_CLAWHUB_",
  "OPENCLAW_DISABLE_",
  "OPENCLAW_SKIP_",
];

The fix introduced in commit 018494fa3ebb9145112e68b56fe1cb2e9f9a9ed6 modifies the array to include the base namespace. By appending the root prefix, the application correctly adopts a fail-closed approach for all internal runtime variables.

// src/infra/dotenv.ts (Patched Implementation)
const BLOCKED_WORKSPACE_DOTENV_PREFIXES = [
  "ANTHROPIC_API_KEY_",
  "CLAWHUB_",
  "OPENAI_API_KEY_",
  "OPENCLAW_",
  "OPENCLAW_CLAWHUB_",
  "OPENCLAW_DISABLE_",
  "OPENCLAW_SKIP_",
];

This patch ensures that any workspace variable starting with OPENCLAW_ is explicitly ignored. System-level and globally trusted environment variables remain unaffected, successfully restricting control of the OPENCLAW_ namespace to authorized scopes.

Exploitation and Attack Vector

Exploitation requires user interaction. The attacker must construct a malicious repository containing a .env file engineered to override internal application variables. A common payload targets the OPENCLAW_GIT_DIR variable to redirect version control operations to an attacker-controlled directory.

# Malicious .env payload
OPENCLAW_GIT_DIR=/tmp/attacker_controlled_git
OPENCLAW_WORKSPACE_DIR=/tmp/malicious_payloads

When the victim opens this repository using OpenClaw, the vulnerable dotenv.ts logic imports these variables into the application context. Subsequent operations performed by OpenClaw, such as updating plugins or pulling repository data, will utilize the poisoned OPENCLAW_GIT_DIR path.

If the attacker provisions the target directory with malicious git hooks or executable binaries, OpenClaw will execute them automatically. This results in arbitrary code execution operating under the privileges of the victim user.

Impact Assessment

The primary impact of this vulnerability is arbitrary code execution. An attacker successfully exploiting this flaw gains the ability to execute OS-level commands on the host machine. This execution occurs silently during standard application operation.

The attacker inherits the privileges of the user running the OpenClaw process. This access allows the exfiltration of sensitive local data, including ssh keys, environment variables, and authentication tokens stored on the filesystem. The attacker can also establish persistence through standard local mechanisms.

Due to the localized nature of the attack, external network exploitation without user interaction is not feasible. The attack strictly relies on social engineering or supply-chain contamination to deliver the malicious workspace to the victim machine.

Remediation and Mitigation

The maintainers of OpenClaw addressed this vulnerability in version 2026.4.20. Users must update their installations to this version or later to eliminate the vulnerability. The patch correctly secures the runtime variable namespace.

If immediate upgrading is unfeasible, users must avoid opening untrusted workspaces with OpenClaw. Manual inspection of a repository's .env file prior to execution provides an effective interim mitigation. Users should specifically look for variables attempting to declare the OPENCLAW_ prefix.

Organizations utilizing OpenClaw in automated pipelines should restrict workspace processing to verified, internal repositories. Security scanning tools can be configured to detect malicious .env declarations dynamically during the CI/CD initialization phases.

Official Patches

OpenClawGitHub Security Advisory for OpenClaw

Fix Analysis (1)

Technical Appendix

CVSS Score
7.8/ 10

Affected Systems

OpenClaw npm package (< 2026.4.20)

Affected Versions Detail

Product
Affected Versions
Fixed Version
openclaw
OpenClaw
< 2026.4.202026.4.20
AttributeDetail
Attack VectorLocal / User Interaction
ImpactArbitrary Code Execution
CWE IDCWE-829
Exploit StatusProof of Concept
Patched Version2026.4.20

MITRE ATT&CK Mapping

T1204.002User Execution: Malicious File
Execution
T1574Hijack Execution Flow
Privilege Escalation
CWE-829
Inclusion of Functionality from Untrusted Control Sphere

Inclusion of Functionality from Untrusted Control Sphere

Vulnerability Timeline

Fix commit pushed to openclaw repository
2026-04-20
Patched version 2026.4.20 released to npm
2026-04-20
Advisory published via GitHub Security Advisories
2026-04-26

References & Sources

  • [1]GitHub Security Advisory GHSA-hxvm-xjvf-93f3
  • [2]Fix Commit 018494f
  • [3]Aliyun Vulnerability Database AVD-2026-1868829

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.

More Reports

•40 minutes ago•CVE-2026-86046
7.1

CVE-2026-86046: Arbitrary File Write via Path Traversal in termux-sync Restore Workflow

A path traversal vulnerability (CWE-22) in termux-sync prior to version 1.2.4 allows an attacker to overwrite arbitrary files within the Termux environment during the backup restoration process. The flaw stems from the application trusting attacker-controlled extraction paths defined in the backup's manifest.json file, failing to validate archive members against directory traversal sequences during tar extraction, and using unsanitized backup names when constructing temporary directories. If a user restores a malicious backup archive from local storage, shared folders, GitHub, or Google Drive, an attacker can overwrite sensitive configuration files such as shell startup scripts or local binaries, resulting in arbitrary code execution under the privileges of the Termux user.

Amit Schendel
Amit Schendel
1 views•11 min read
•about 2 hours ago•CVE-2026-129296
6.5

CVE-2026-129296: Path Traversal in SpamScope mail-parser Attachment Extraction

SpamScope mail-parser versions 3.8.0 prior to 4.6.0 contain a path traversal vulnerability (CWE-22) within the write_attachments() and write_sample() functions. The library passes untrusted attachment filenames directly into os.path.join() without stripping directory components, validating path containment, or verifying symbolic links. An attacker can send a crafted email containing relative path traversal sequences or absolute filesystem paths in the Content-Disposition header to write or overwrite arbitrary files accessible to the parsing process.

Amit Schendel
Amit Schendel
2 views•9 min read
•about 3 hours ago•CVE-2026-129295
7.5

CVE-2026-129295: Polynomial Regular Expression Denial of Service (ReDoS) in SpamScope mail-parser

A Regular Expression Denial of Service (ReDoS) vulnerability exists in SpamScope mail-parser versions 4.2.0 prior to 4.6.1. Two separate regular expressions evaluated during standard email header parsing exhibit quadratic to cubic backtracking complexity when processing headers padded with whitespace or angle brackets. An unauthenticated remote attacker can exploit this flaw by sending a small, RFC-compliant email message, causing parsing worker threads or processes to stall at 100% CPU utilization for extended periods.

Amit Schendel
Amit Schendel
2 views•10 min read
•about 4 hours ago•CVE-2026-129297
7.5

CVE-2026-129297: Sender IP Address Spoofing in SpamScope mail-parser

CVE-2026-129297 is an origin validation vulnerability (CWE-345) in the Python library mail-parser prior to version 4.6.2. The MailParser.get_server_ipaddress() method fails to properly isolate MTA-recorded client IP addresses from sender-controlled text within email Received headers. Due to naive substring delimiter matching, appearance-based regular expression scanning, and fail-open header traversal, remote attackers can spoof their originating IP address to bypass email security controls, blocklists, and anti-spam attribution.

Amit Schendel
Amit Schendel
2 views•11 min read
•about 5 hours ago•CVE-2026-129299
6.5

CVE-2026-129299: Uncaught Exceptions and Silent Header Loss via Reflective Attribute Dispatch in SpamScope mail-parser

CVE-2026-129299 (GHSA-24mq-4vc6-2prf) is a parsing and serialization flaw in SpamScope mail-parser prior to version 4.6.2. The library uses reflective Python attribute resolution (getattr) over untrusted email header names and applies caller convenience transformations (such as underscore-to-hyphen folding and _json/_raw suffix stripping) directly to wire headers. An unauthenticated remote attacker can send crafted emails that trigger uncaught TypeError exceptions during JSON serialization or cause security-relevant headers and body content to be silently dropped without setting defect indicators.

Amit Schendel
Amit Schendel
3 views•11 min read
•about 6 hours ago•CVE-2026-129236
7.2

CVE-2026-129236: Command-Line Argument Injection in Kubeshark MCP Server

CVE-2026-129236 is a command-line argument injection vulnerability (CWE-88) in Kubeshark, an eBPF-based network observability tool for Kubernetes. Located within the Model Context Protocol (MCP) server implementation in cmd/mcpRunner.go, the flaw occurs when handling the start_kubeshark tool request. When the MCP server runs with the --allow-destructive flag, the callStartKubeshark function appends the caller-supplied pod_regex parameter directly to the kubeshark tap argument slice without an end-of-options (--) delimiter. Because Kubeshark uses the Cobra and pflag libraries for command-line parsing, any pod_regex value prefixed with a hyphen is interpreted as a CLI flag rather than a positional regular expression. An attacker capable of influencing MCP tool arguments, such as through indirect prompt injection against a connected Large Language Model (LLM) agent, can inject the --set flag to override Helm chart values like tap.docker.registry. Because Kubeshark deploys its worker DaemonSet with privileged security contexts and host networking enabled, redirecting the container image registry allows arbitrary code execution as root across all Kubernetes cluster nodes.

Alon Barad
Alon Barad
6 views•11 min read