CVE-2026-41387
Host Env Variable Sanitization Flaw in OpenClaw Enables Code Execution
Publication date: 2026-04-28
Last updated on: 2026-04-30
Assigner: VulnCheck
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| openclaw | openclaw | to 2026.3.22 (exc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-183 | The product implements a protection mechanism that relies on a list of inputs (or properties of inputs) that are explicitly allowed by policy because the inputs are assumed to be safe, but the list is too permissive - that is, it allows an input that is unsafe, leading to resultant weaknesses. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2026-41387 is a critical vulnerability in OpenClaw versions before 2026.3.22 caused by incomplete sanitization of host environment variables. Specifically, the vulnerability exists in the files host-env-security-policy.json and host-env-security.ts, where insufficient filtering allows attackers to override package-manager environment variables.
This flaw enables attackers to exploit approved execution requests to redirect package resolution or runtime bootstrap processes to attacker-controlled infrastructure, which can lead to the execution of trojanized (malicious) content.
The underlying weakness is classified as CWE-183 (Permissive List of Allowed Inputs), meaning the protection mechanism relies on an overly permissive allowlist that fails to exclude unsafe inputs, leading to security weaknesses.
How can this vulnerability impact me? :
This vulnerability can have severe impacts because it allows attackers to redirect package resolution or runtime bootstrap to attacker-controlled infrastructure.
As a result, attackers can execute trojanized content, which means malicious code can run within your environment without detection.
- Potential execution of malicious code.
- Compromise of system integrity and confidentiality.
- Possible disruption of service availability.
The vulnerability requires no privileges and can be exploited remotely with some user interaction, making it easier for attackers to leverage.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability involves incomplete sanitization of host environment variables that allow attackers to override package-manager environment variables, potentially redirecting package resolution or runtime bootstrap to attacker-controlled infrastructure.
To detect this vulnerability on your system, you should check the version of OpenClaw installed and inspect the environment variables related to the package manager for any suspicious overrides.
- Check OpenClaw version: `openclaw --version` or check the installed package version to ensure it is 2026.3.22 or later.
- List environment variables related to package management and host environment overrides, for example: `env | grep -i 'OPENCLAW'` or `env | grep -E 'PACKAGE_MANAGER|HOST_ENV'`.
- Monitor execution requests or logs for any unexpected redirection or network calls to unknown or attacker-controlled infrastructure.
What immediate steps should I take to mitigate this vulnerability?
The primary mitigation step is to upgrade OpenClaw to version 2026.3.22 or later, as this version contains the fix for the incomplete host environment variable sanitization vulnerability.
Additionally, you should audit and restrict environment variables related to package management to prevent unauthorized overrides.
- Upgrade OpenClaw to version 2026.3.22 or later (latest stable release 2026.3.28 contains the fix).
- Review and harden host environment variable policies to block unsafe or unexpected inputs.
- Monitor and restrict execution requests that could be exploited to redirect package resolution or runtime bootstrap.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The provided information does not specify how CVE-2026-41387 affects compliance with common standards and regulations such as GDPR or HIPAA.