CVE-2026-41336

7.8

OpenClaw · OpenClaw

OpenClaw versions before 2026.3.31 are vulnerable to arbitrary code execution due to improper handling of the OPENCLAW_BUNDLED_HOOKS_DIR environment variable via workspace .env files.

Executive summary

A critical vulnerability in OpenClaw allows local attackers to achieve arbitrary code execution by overriding environment variables through workspace configuration files.

Vulnerability

This flaw involves the inclusion of functionality from an untrusted control sphere (CWE-829), where workspace .env files can override the OPENCLAW_BUNDLED_HOOKS_DIR variable. This allows unauthenticated, local attackers to force the application to load malicious hook code instead of trusted defaults.

Business impact

The ability to execute arbitrary code on the host system presents a severe security risk, potentially leading to a full system compromise, unauthorized data access, and lateral movement within the network. Although the attack requires local access, the CVSS score of 7.8 reflects the high impact on confidentiality, integrity, and availability once the attacker successfully triggers the malicious hook execution.

Remediation

Immediate Action: Update the OpenClaw package to version 2026.3.31 or later to ensure the environment variable override is properly restricted.

Proactive Monitoring: Review access logs and workspace configurations for unauthorized changes to .env files or unexpected modifications to environment variables in the deployment environment.

Compensating Controls: Implement strict file system permissions to prevent untrusted users from creating or modifying workspace-specific configuration files that could influence the application environment.

Exploitation status

Public Exploit Available: Unknown

Analyst recommendation

This vulnerability represents a significant risk to systems utilizing OpenClaw by allowing local privilege escalation through configuration manipulation. Security teams must prioritize updating the software to version 2026.3.31 immediately to prevent potential exploitation of the hook loading mechanism.

More OpenClaw CVEs

Sources

Originally found and disclosed by Nathan (@nexrin), KeenSecurityLab, per the CVE Program record.