CVE-2026-41391·Python vulnerability
OpenClaw before 2026.3.31 fails to properly sanitize PIP_INDEX_URL and UV_INDEX_URL environment variables in host execution contexts, allowing attackers to redirect Python package-index traffic. Attackers can exploit this bypass to intercept or manipulate package management operations by injecting malicious index URLs through unsanitized environment variables.
- Severity
- medium
- Software
- Python
- Fixed in
- 2026.3.31
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.13% — higher than 3% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
Until: 2026.3.31
Fixed in: 2026.3.31
How to fix this CVE
Update OpenClaw and Python to the patched version 2026.3.31 or later to prevent environment variable injection attacks on package index URLs. Audit your system for any custom PIP_INDEX_URL or UV_INDEX_URL environment variable configurations and replace them with official package index settings. After patching, validate that Python package installations only connect to legitimate package repositories.
sudo dnf update python3 && pip install --upgrade openclaw>=2026.3.31Defensia detects this vulnerability
How to check if you are affected
- Run `python3 --version` to check your installed Python version and confirm it includes the OpenClaw security patch from version 2026.3.31 or later.
- Execute `env | grep -E '(PIP_INDEX_URL|UV_INDEX_URL)'` to identify any custom package index URLs set in your environment that could be exploited.
- Search system logs with `grep -r 'PIP_INDEX_URL\|UV_INDEX_URL' /var/log/ /home/*/.bash_history 2>/dev/null` to detect if malicious index URLs have been injected.
- Verify the patch by running `pip show openclaw` and confirming the version is 2026.3.31 or later; additionally, check `/proc/[python-pid]/environ` for any suspicious index configurations in running Python processes.
FAQ
What is CVE-2026-41391?
CVE-2026-41391 is a vulnerability in OpenClaw that fails to sanitize PIP_INDEX_URL and UV_INDEX_URL environment variables, allowing attackers with local access to redirect Python package installations to malicious repositories and intercept or modify packages before installation.
Is CVE-2026-41391 being actively exploited?
No, according to CISA's Known Exploited Vulnerabilities list, CVE-2026-41391 is not currently being actively exploited in the wild, and no public exploit code is available.
What versions of Python are affected by CVE-2026-41391?
All OpenClaw versions prior to 2026.3.31 are affected. The vulnerability impacts any Python installation using affected versions of OpenClaw for package management.
How do I check if my server is vulnerable to CVE-2026-41391?
Run `pip show openclaw | grep Version` to get your OpenClaw version; if it is older than 2026.3.31, your system is vulnerable. Additionally, check for suspicious environment variables with `env | grep -E '(PIP_INDEX_URL|UV_INDEX_URL)'`.
Does Defensia detect CVE-2026-41391?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If OpenClaw or Python is installed on a monitored server, CVE-2026-41391 will appear in your dashboard with remediation steps.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-41391. Free for 1 server.
Get started free