OpenClaw Vulnerability: Unvalidated SHELL Path in Environment Fallback
Summary
GHSA-f8mp-vj46-cq8v: OpenClaw's shell env fallback trusts unvalidated SHELL path from host environment. Affects openclaw versions < 2026.2.22. Fixed in 2026.2.22. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
OpenClaw is a package designed for managing shell environments in Node.js applications. It allows developers to interact with the shell and execute commands seamlessly. However, it has a vulnerability that arises from trusting the SHELL environment variable without validation, potentially allowing an attacker to execute arbitrary commands if the environment is compromised.
Vulnerability Detail
The vulnerability in OpenClaw stems from its reliance on the SHELL environment variable, which can be manipulated by an attacker in an untrusted environment. When OpenClaw attempts to load the shell environment using the command '$SHELL -l -c 'env -0'', it does not validate whether the SHELL variable points to a trusted executable. This oversight can lead to the execution of malicious commands, posing a significant security risk. The vulnerability is classified under CWE-426 (Use of Untrusted Search Path) and CWE-78 (OS Command Injection), with a CVSS score of 4.5, indicating a moderate severity level.
How To Fix
Latest published version: 2026.10.6 as of 22 Oct 2026
npm install openclaw@2026.10.6
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
2026.2.22
This is the first release that contains the fix.
npm install openclaw@2026.2.22
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can unset the SHELL environment variable before running OpenClaw by executing the following command in your terminal: 'unset SHELL'. This will prevent OpenClaw from using an untrusted SHELL path, but it is recommended to update to the patched version as soon as possible for a permanent fix.
Conclusion
The OpenClaw package has a vulnerability related to unvalidated SHELL paths that can lead to command injection if exploited. It is crucial to update to the patched version 2026.2.22 to mitigate this risk. Additionally, using tools like Vulert can help monitor for such vulnerabilities in real-time.
See every vulnerability recorded for openclaw →
FAQ
The vulnerability allows for the execution of arbitrary commands due to unvalidated SHELL paths inherited from the host environment.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without any signup.
Update OpenClaw to version 2026.2.22 or later to apply the necessary security patch.
Failure to address this vulnerability could lead to unauthorized command execution, compromising the security of your application.
Yes, you can unset the SHELL environment variable temporarily as a workaround until you can update to the patched version.
References
Related vulnerabilities
Recent vulnerabilities recorded for openclaw.