Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
High

Arbitrary Hook Code Execution in OpenClaw via OPENCLAW_BUNDLED_HOOKS_DIR Override

IdentifiersCVE-2026-41336CWE-829· Inclusion of Functionality from…

CVE-2026-41336 affects OpenClaw versions before 2026.3.31. The vulnerability arises because a workspace-local .env file can override the OPENCLAW_BUNDLED_HOOKS_DIR environment variable, which controls the directory from which bundled hooks are loaded. By supplying an untrusted workspace containing a crafted .env file, an attacker can redirect OpenClaw to load attacker-controlled hook code in place of trusted default-on bundled hooks. This results in arbitrary code execution in the context of the user running OpenClaw when the malicious workspace is opened or otherwise processed with the affected hook-loading behavior.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation allows arbitrary code execution through attacker-controlled hook loading. Because the malicious code is executed as hook code within OpenClaw, an attacker can compromise the confidentiality, integrity, and availability of the affected user's environment and data accessible to the OpenClaw process. The provided CVSS vectors indicate high impact to confidentiality, integrity, and availability.

Mitigation

If you can’t patch tonight, do this now.

Do not open or process untrusted workspaces with vulnerable OpenClaw versions. Prevent workspace-provided .env files from influencing runtime environment variables, especially OPENCLAW_BUNDLED_HOOKS_DIR. Where operationally feasible, disable or restrict automatic/default-on hook loading, and run OpenClaw only with trusted workspaces until the patched version is deployed.

Remediation

Patch, then assume compromise.

Upgrade OpenClaw to version 2026.3.31 or later, which addresses the unsafe ability of workspace .env files to override OPENCLAW_BUNDLED_HOOKS_DIR for bundled hook resolution. Apply the vendor fix referenced by the associated GitHub commit and security advisory.
PUBLIC EXPLOITS

Exploits

No public exploits tracked yet. Mallory keeps watching.

VALID 0 / 0 TOTALView more in app

No public exploit code observed for this vulnerability.

EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
OpenclawOpenclawapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity3

Community discussion across Reddit, Mastodon, and other social sources.