
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-41336 is a code inclusion vulnerability in OpenClaw (npm package) that allows workspace .env files to override the OPENCLAW_BUNDLED_HOOKS_DIR environment variable, enabling an attacker to redirect hook loading to attacker-controlled code and achieve arbitrary code execution. All versions of the openclaw npm package up to and including v2026.3.28 are affected; the issue was fixed in v2026.3.31. The vulnerability was reported by researcher nexrin, sponsored by KeenSecurityLab, and disclosed on March 31, 2026, with CVE assignment on April 23, 2026. It carries a CVSS v3.1 score of 7.8 (High) and a CVSS v4.0 score of 8.5 (High) (GitHub Advisory, Github Advisory).
The root cause is classified as CWE-829 (Inclusion of Functionality from Untrusted Control Sphere): OpenClaw's dotenv loading logic did not block workspace-level .env files from setting the OPENCLAW_BUNDLED_HOOKS_DIR (and related OPENCLAW_BUNDLED_PLUGINS_DIR, OPENCLAW_BUNDLED_SKILLS_DIR) environment variables, which control where the application loads trusted bundled hook code from. An attacker crafts a malicious workspace containing a .env file that sets OPENCLAW_BUNDLED_HOOKS_DIR=./attacker-hooks, pointing to attacker-supplied hook scripts. When a victim user opens or interacts with the workspace, OpenClaw loads the attacker's hook code in place of the trusted bundled defaults, executing it with the user's privileges. The fix (commit 330a9f9) adds these variables to a BLOCKED_WORKSPACE_DOTENV_KEYS denylist, preventing workspace .env files from overriding them (GitHub Advisory, Fix Commit).
Successful exploitation results in arbitrary code execution with the privileges of the victim user who opens the malicious workspace, yielding high confidentiality, integrity, and availability impact on the affected system. An attacker can read sensitive files and credentials accessible to the user, modify or delete data, and disrupt availability. Because no elevated privileges are required to craft the malicious workspace, the attack surface includes any user who opens an untrusted OpenClaw workspace, making supply-chain or social-engineering delivery vectors realistic (Github Advisory, GitHub Advisory).
There is no public proof-of-concept exploit and no evidence of in-the-wild exploitation at the time of disclosure (Feedly). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score is approximately 0.013% (0.000130), indicating a very low probability of exploitation in the near term. Exploitation requires user interaction — a victim must open a malicious workspace — which limits opportunistic exploitation but does not preclude targeted attacks via shared or distributed workspaces.
.env file with the entry OPENCLAW_BUNDLED_HOOKS_DIR=./attacker-hooks (and optionally OPENCLAW_BUNDLED_PLUGINS_DIR=./attacker-plugins, OPENCLAW_BUNDLED_SKILLS_DIR=./attacker-skills)../attacker-hooks directory within the workspace with malicious hook scripts (e.g., Node.js files) that execute the desired payload — such as a reverse shell, credential harvester, or persistence mechanism..env file and sets OPENCLAW_BUNDLED_HOOKS_DIR to the attacker-controlled path..env file in a workspace directory containing entries for OPENCLAW_BUNDLED_HOOKS_DIR, OPENCLAW_BUNDLED_PLUGINS_DIR, or OPENCLAW_BUNDLED_SKILLS_DIR pointing to non-standard or relative paths; unexpected directories named attacker-hooks, attacker-plugins, or attacker-skills within workspace folders; unfamiliar or unsigned hook/plugin script files in workspace subdirectories.curl, wget, or nc); unusual outbound network connections originating from the OpenClaw process.OPENCLAW_BUNDLED_HOOKS_DIR set to a workspace-relative path.Users should upgrade the openclaw npm package to version 2026.3.31 or later, which blocks workspace .env files from overriding OPENCLAW_BUNDLED_HOOKS_DIR, OPENCLAW_BUNDLED_PLUGINS_DIR, and OPENCLAW_BUNDLED_SKILLS_DIR via a denylist (GitHub Advisory, Fix Commit). As an interim workaround prior to patching, users should avoid opening workspaces from untrusted or unknown sources, and should inspect any workspace .env files for suspicious entries before loading them. Existing workspaces should be audited for unexpected .env modifications that reference non-standard hook or plugin directories.
The vulnerability was reported by researcher nexrin and sponsored by KeenSecurityLab, with the fix credited to contributor vincentkoc (GitHub Advisory). VulnCheck published an advisory covering the issue. No significant broader media coverage or notable community debate has been identified beyond standard vulnerability tracking sites.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."