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-82G8-464F-2MV7

Arbitrary Code Execution via Environment Variable Injection in OpenClaw

Alon Barad
Alon Barad
Software Engineer

Feb 27, 2026·5 min read·38 visits

Executive Summary (TL;DR)

OpenClaw versions < v2026.2.21 fail to sanitize environment variables defined in skill configurations. This allows attackers with local configuration write access to inject variables like `NODE_OPTIONS`, leading to arbitrary code execution when the application spawns new processes.

A critical vulnerability in the OpenClaw AI assistant framework allows for arbitrary code execution through unsafe handling of environment variable overrides in skill configurations. The flaw exists in the `applySkillConfigEnvOverrides` function, which merges configuration-defined environment variables into the process environment without validation. Attackers capable of modifying skill configurations or the main `openclaw.json` file can inject malicious environment variables—such as `NODE_OPTIONS` or `LD_PRELOAD`—to hijack the execution flow of the Node.js runtime or underlying system processes. This issue affects all versions prior to v2026.2.21.

Vulnerability Overview

OpenClaw is an open-source AI assistant framework designed to integrate various "skills" that extend its capabilities. To support these skills, the framework includes a mechanism to inject or override environment variables required by specific toolchains or APIs. This functionality is handled by the applySkillConfigEnvOverrides function located in src/agents/skills/env-overrides.ts.

The vulnerability stems from a lack of input validation in this environment injection logic. The framework blindly trusts the key-value pairs provided in the skill configuration (typically found in openclaw.json or skill metadata) and merges them directly into process.env. This creates a mechanism for privilege escalation and persistence.

While this is characterized as a "Defense-in-Depth" issue—implying that an attacker typically needs prior access to modify configuration files—it significantly changes the risk profile of configuration management. A simple file write vulnerability or a malicious skill installation can be escalated immediately to full Arbitrary Code Execution (ACE) by leveraging Node.js runtime behaviors controlled by environment variables.

Root Cause Analysis

The root cause is the unrestricted assignment of user-controlled input to the sensitive process.env object. In Node.js, process.env controls not just the application's configuration, but also the behavior of the Node.js runtime and any child processes spawned by the application.

The vulnerable code iterates through the env object defined in a skill's configuration and assigns each property to process.env if it is not already set. The logic failed to implement a blocklist for dangerous keys or an allowlist for permitted keys.

Specifically, the following dangerous environment variables were left exposed:

  • NODE_OPTIONS: This variable allows passing command-line arguments to the Node.js process. An attacker can set this to --require /path/to/malicious.js, causing the runtime to load and execute arbitrary code before the main application logic starts in any subsequent Node.js processes spawned by OpenClaw.
  • LD_PRELOAD / DYLD_INSERT_LIBRARIES: On Linux and macOS respectively, these variables force the dynamic linker to load specified shared objects before others, enabling native code injection.
  • OPENSSL_CONF: This can be manipulated to load a malicious OpenSSL configuration file, potentially allowing code execution via a specially crafted engine.

Code Analysis

The vulnerability existed in src/agents/skills/env-overrides.ts. Below is the comparison between the vulnerable implementation and the patched version in commit 8c9f35cdb51692b650ddf05b259ccdd75cc9a83c.

Vulnerable Implementation

The original code iterated through the configuration object and applied values directly, assuming the configuration source was trustworthy.

// src/agents/skills/env-overrides.ts (Pre-patch)
 
export function applySkillConfigEnvOverrides(skillConfig: SkillConfig) {
  if (skillConfig.env) {
    for (const [key, value] of Object.entries(skillConfig.env)) {
      // Flaw: No check against dangerous keys like NODE_OPTIONS
      if (!process.env[key] && value) {
        process.env[key] = value;
      }
    }
  }
}

Patched Implementation

The fix introduces a strict validation layer. It defines a HARD_BLOCKED_SKILL_ENV_PATTERNS constant containing regex patterns for known dangerous variables. It also implements a sanitizeSkillEnvOverrides function that filters input against this blocklist and verifies that overridden variables are explicitly declared in the skill's metadata.

// src/agents/skills/env-overrides.ts (Patched)
 
const HARD_BLOCKED_SKILL_ENV_PATTERNS: ReadonlyArray<RegExp> = [
  /^NODE_OPTIONS$/i,
  /^OPENSSL_CONF$/i,
  /^LD_PRELOAD$/i,
  /^DYLD_INSERT_LIBRARIES$/i,
];
 
function sanitizeSkillEnvOverrides(env: Record<string, string>, metadata: SkillMetadata) {
  const sanitized: Record<string, string> = {};
  
  for (const [key, value] of Object.entries(env)) {
    // 1. Check Blocklist
    if (HARD_BLOCKED_SKILL_ENV_PATTERNS.some(p => p.test(key))) {
      console.warn(`Blocked dangerous env var override: ${key}`);
      continue;
    }
    
    // 2. Validate against metadata allowlist (requires.env)
    if (metadata.requires?.env?.includes(key)) {
       sanitized[key] = value;
    }
  }
  return sanitized;
}

Exploitation Methodology

To exploit this vulnerability, an attacker must influence the configuration loaded by OpenClaw. This is typically achieved by modifying the ~/.openclaw/openclaw.json file or by distributing a malicious skill that users install.

Attack Scenario: NODE_OPTIONS Injection

  1. Preparation: The attacker creates a malicious JavaScript payload (e.g., /tmp/pwn.js) that establishes a reverse shell.
  2. Configuration Injection: The attacker modifies the local OpenClaw configuration or a skill configuration to include the following:
    {
      "skills": {
        "example-skill": {
          "env": {
            "NODE_OPTIONS": "--require /tmp/pwn.js"
          }
        }
      }
    }
  3. Trigger: The next time OpenClaw starts or spawns a child process (which inherits process.env), the Node.js runtime detects NODE_OPTIONS.
  4. Execution: Node.js processes the --require flag, loading /tmp/pwn.js and executing the payload immediately upon startup, granting the attacker control over the process.

Impact Assessment

The impact of successful exploitation is Arbitrary Code Execution (ACE) with the privileges of the user running the OpenClaw process. Since OpenClaw is often run by developers or on personal workstations, this typically results in full user compromise.

Confidentiality

The attacker gains access to all files accessible by the user, including SSH keys, cloud credentials, and source code. Furthermore, since process.env is polluted, the attacker can trivially exfiltrate other sensitive environment variables (e.g., OPENAI_API_KEY, database connection strings).

Integrity

The attacker can modify application logic, install persistent backdoors (e.g., modifying shell profiles or adding cron jobs), and alter local data.

Availability

The attacker can crash the application, delete critical files, or use the compromised machine for cryptomining or botnet activities, degrading system performance.

Remediation & Mitigation

The primary remediation is to upgrade OpenClaw to version v2026.2.21 or later. This version includes the patch that enforces blocklisting of dangerous environment variables and validates overrides against skill metadata.

Immediate Steps

  1. Upgrade: Run npm install -g openclaw@latest (or the equivalent package manager command).
  2. Audit Configuration: Manually inspect ~/.openclaw/openclaw.json and any skill-specific configuration files for suspicious env entries, particularly NODE_OPTIONS.
  3. File Permissions: Restrict write access to the OpenClaw configuration directory to only the necessary user account to prevent unauthorized modification.

Developer Guidance

For developers maintaining forks or similar systems, ensure that any feature allowing environment variable overrides employs a strict allowlist approach. Never allow user-supplied input to define structural environment variables like NODE_OPTIONS, LD_PRELOAD, or PATH without rigorous sanitation.

Official Patches

OpenClawOfficial patch commit

Fix Analysis (1)

Technical Appendix

CVSS Score
7.8/ 10
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Affected Systems

OpenClaw Framework

Affected Versions Detail

Product
Affected Versions
Fixed Version
OpenClaw
OpenClaw
< v2026.2.21v2026.2.21
AttributeDetail
CWE IDCWE-78
Attack VectorLocal (Configuration)
CVSS Score7.8 (High)
ImpactArbitrary Code Execution
Affected Versions< v2026.2.21
Exploit StatusPoC Available

MITRE ATT&CK Mapping

T1574.012Hijack Execution Flow: Environment Variables
Persistence
T1059.007Command and Scripting Interpreter: JavaScript
Execution
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Known Exploits & Detection

Internal ResearchIntegration test demonstrating NODE_OPTIONS injection via skill config

Vulnerability Timeline

Fix Committed
2026-02-20
Patch Released (v2026.2.21)
2026-02-21

References & Sources

  • [1]Patch Commit
  • [2]Node.js Documentation: NODE_OPTIONS

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

•about 10 hours ago•CVE-2026-54068
5.9

CVE-2026-54068: Unauthenticated Server-Side Template Injection and SQLite Exfiltration in SiYuan PKM

An authentication bypass in the SiYuan personal knowledge management system before version 3.7.0 exposes a dynamic icon rendering endpoint. This endpoint processes client-supplied Go template directives. By submitting a crafted request, an unauthenticated remote attacker can leverage registered database template functions to execute arbitrary read-only SQL queries and exfiltrate workspace contents.

Amit Schendel
Amit Schendel
5 views•5 min read
•about 10 hours ago•CVE-2026-54069
9.1

CVE-2026-54069: Authentication Bypass in SiYuan Note via Origin Header Spoofing

CVE-2026-54069 is a critical authentication bypass vulnerability in the SiYuan Note personal knowledge management system. The flaw is located in the HTTP server's middleware handling API authorization, which unconditionally trusts requests carrying a 'chrome-extension://' scheme in the Origin HTTP header, granting administrative access without validating API tokens.

Alon Barad
Alon Barad
4 views•5 min read
•about 11 hours ago•CVE-2026-54089
9.1

CVE-2026-54089: Authentication Bypass by Spoofing in File Browser

CVE-2026-54089 is a critical authentication bypass vulnerability in File Browser affecting instances configured with proxy-based authentication. An unauthenticated remote attacker with direct network access can impersonate arbitrary users or register new accounts by spoofing configured HTTP headers.

Amit Schendel
Amit Schendel
4 views•7 min read
•about 11 hours ago•GHSA-99J7-FHR2-XFJ4
10.0

GHSA-99J7-FHR2-XFJ4: Malicious Remote Code Execution Payload in 'exploration' Cargo Crate

The malicious Cargo package 'exploration' was uploaded to the crates.io registry. During compilation or package import, the crate executes code designed to establish an outbound TCP/HTTP connection, download an external second-stage binary, and execute the binary locally on the host machine. This creates an unauthenticated remote code execution vector impacting developer environments and continuous integration pipelines.

Amit Schendel
Amit Schendel
7 views•6 min read
•about 12 hours ago•CVE-2026-54088
9.3

CVE-2026-54088: Pre-Authentication Remote Code Execution in File Browser Hook Authentication

CVE-2026-54088 is a critical command injection vulnerability in File Browser prior to version 2.63.6. When Hook Authentication is enabled, the application interpolates unsanitized credentials into a shell command, allowing unauthenticated remote code execution.

Alon Barad
Alon Barad
6 views•6 min read
•about 12 hours ago•GHSA-QV4M-M73M-8HJ7
8.8

GHSA-qv4m-m73m-8hj7: Authenticated Arbitrary File Upload leading to Remote Code Execution in NotrinosERP

An authenticated remote code execution vulnerability exists in NotrinosERP (versions up to and including 1.0.0) within the Human Resource Management (HRM) module. Users with employee management permissions can upload arbitrary file types, including PHP scripts, which are written directly to a web-accessible directory. This allows for arbitrary code execution in the context of the web-server user.

Alon Barad
Alon Barad
5 views•6 min read