OpenClaw NPM Package Vulnerable to Python Package Index Redirection
The openclaw npm package is vulnerable to Python package-index redirection through host execution due to improper sanitization of `PIP_INDEX_URL` and `UV_INDEX_URL`, affecting versions 2026.3.28 and earlier.
The openclaw npm package, versions 2026.3.28 and earlier, contains a vulnerability that allows for the redirection of Python package-index traffic. This is due to insufficient sanitization of the PIP_INDEX_URL and UV_INDEX_URL environment variables during host execution. An attacker can potentially exploit this vulnerability to redirect package installation traffic to a malicious index, potentially leading to the installation of compromised packages. The scope of this vulnerability is limited to approved or allowlisted package-management execution paths, mitigating the risk of arbitrary remote execution. Version 2026.3.31 and later contain the fix. The vulnerability was reported by @nexrin.
Attack Chain
- An attacker identifies a system using a vulnerable version (<=2026.3.28) of the
openclawnpm package. - The attacker gains access to the system or its environment configuration.
- The attacker sets either the
PIP_INDEX_URLorUV_INDEX_URLenvironment variable to point to a malicious Python package index server. - The system executes a package installation command (e.g.,
pip install <package>) throughopenclaw. openclaw, without proper sanitization, uses the attacker-controlled environment variable when resolving package dependencies.- The package manager connects to the malicious index server specified in the
PIP_INDEX_URLorUV_INDEX_URLvariable. - The attacker serves malicious or backdoored Python packages through the rogue index.
- The system installs the malicious packages, potentially compromising the system with arbitrary code execution.
Impact
Successful exploitation of this vulnerability could lead to the installation of malicious Python packages on systems utilizing the vulnerable openclaw version. This could result in arbitrary code execution, data theft, or other malicious activities, depending on the contents of the malicious packages. The scope is somewhat limited since only allowlisted execution paths are affected, which reduces the blast radius.
Recommendation
- Upgrade the
openclawnpm package to version 2026.3.31 or later to remediate the vulnerability. - Monitor process executions involving
openclawand the use ofPIP_INDEX_URLorUV_INDEX_URLenvironment variables. Deploy the Sigma ruleDetect OpenClaw Using Suspicious Index URLto detect exploitation attempts. - Implement strict allowlisting of package management execution paths to further limit the potential impact.
- Enable process creation logging to capture command line arguments and environment variables for the
openclawprocess.
Detection coverage 2
Detect OpenClaw Using Suspicious Index URL
highDetects the use of openclaw with potentially malicious PIP_INDEX_URL or UV_INDEX_URL environment variables.
Detect OpenClaw Execution
lowDetects execution of openclaw, which should be monitored for suspicious activity given the vulnerability.
Detection queries are kept inside the platform. Get full rules →