OpenClaw Vulnerability: Arbitrary Code Execution via .env File Override
The National Vulnerability Database has disclosed CVE-2026-41336, a high-severity vulnerability affecting OpenClaw prior to version 2026.3.31. This flaw allows workspace .env files to override the OPENCLAW_BUNDLED_HOOKS_DIR environment variable, a critical mechanism for maintaining code integrity.
This override capability is a significant problem. Attackers can leverage it to replace legitimate, default-on bundled hooks with their own malicious code. By tricking users into opening an untrusted workspace, an attacker can achieve arbitrary code execution, effectively taking control of the system. The CVSS score of 7.8 (HIGH) underscores the severe impact on confidentiality, integrity, and availability.
This isn’t just a configuration oversight; it’s a direct path to system compromise. Defenders need to recognize that seemingly innocuous configuration files can become potent attack vectors when they can manipulate execution paths. The attacker’s calculus here is simple: target developer environments where OpenClaw is used, knowing that a compromised workspace can yield high-value access.
What This Means For You
- If your organization uses OpenClaw, immediately identify all instances running versions prior to 2026.3.31. Patch these systems to 2026.3.31 or newer without delay. Furthermore, implement strict controls over workspace provenance and educate developers on the risks of opening untrusted projects. This vulnerability allows arbitrary code execution, which means a full system compromise is on the table.
Related ATT&CK Techniques
🛡️ Detection Rules
3 rules · 6 SIEM formats3 detection rules auto-generated for this incident, mapped to MITRE ATT&CK. Sigma YAML is free — export to any SIEM format via the Intel Bot.
CVE-2026-41336: OpenClaw Arbitrary Code Execution via .env Override
Indicators of Compromise
| ID | Type | Indicator |
|---|---|---|
| CVE-2026-41336 | RCE | OpenClaw versions prior to 2026.3.31 |
| CVE-2026-41336 | RCE | Vulnerable component: workspace .env files overriding OPENCLAW_BUNDLED_HOOKS_DIR |
| CVE-2026-41336 | RCE | Attack vector: Loading attacker-controlled hook code via OPENCLAW_BUNDLED_HOOKS_DIR |
Source & Attribution
| Source Platform | NVD |
| Channel | National Vulnerability Database |
| Published | April 24, 2026 at 01:16 UTC |
This content was AI-rewritten and enriched by Shimi's Cyber World based on the original source. All intellectual property rights remain with the original author.
Believe this infringes your rights? Submit a takedown request.