cve.bz

CVE-2026-102938 pypa virtualenv: CRLF Injection

5.8 mediumEPSS 0.1%Fix available

Medium (5.8) in pypa virtualenv. EPSS 0.1% estimated probability of exploitation activity in the next 30 days. Fixed in virtualenv 21.7.11.

On this page
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.7.11, PyEnvCfg.write() writes prompt values verbatim to the line-oriented pyvenv.cfg format while PyEnvCfg._read_values() parses the file with str.splitlines() and accepts the last value for duplicate keys. An attacker who influences --prompt, VIRTUALENV_PROMPT, or configuration input can insert a recognized line boundary and additional keys, including home, causing consumers to use an attacker-selected base interpreter or corrupted environment metadata. The security impact requires prompt input from outside the operator's trust boundary; directly supplied prompt content primarily corrupts the operator's own environment. This issue is fixed in version 21.7.11.

Severity

CVSS 4.0

5.8 medium
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N
EPSS
0.1% (unchanged from 0.1% a week ago; 0.1% 30 days ago) estimated probability of exploitation activity in the next 30 days; 4th percentile. Scored 2026-11-17. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2026-09-30. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-93 Improper Neutralization of CRLF Sequences (CRLF Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Under analysis
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-102938 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-102938?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-102938?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-102938 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
pypa virtualenv< 21.7.11

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-9h9j-4vrj-gf7gPyPIvirtualenv<21.7.1121.7.11
PYSEC-2026-4012PyPIvirtualenv<21.7.1121.7.11

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14python-virtualenvno fix listedDEBIAN-CVE-2026-102938
Ubuntu14.04:LTS, 16.04:LTS, 18.04:LTS and 5 morepython-virtualenvno fix listedUBUNTU-CVE-2026-102938
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise High Performance Computing 15 SP5-ESPOS and 8 morepython-virtualenv20.22.0-150400.9.12.1SUSE-SU-2026:4652-1
SUSELinux Enterprise Server 16.0, Linux Enterprise Server for SAP applications 16.0python-virtualenv20.29.3-160000.4.1SUSE-SU-2026:24243-1
openSUSELeap 16.0python-virtualenv20.29.3-160000.4.1openSUSE-SU-2026:22100-1
openSUSETumbleweedpython-virtualenv21.14.2-1.1openSUSE-SU-2026:11974-1
Azure Linux3python-virtualenv20.36.1-10AZL-105672

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

A flaw was found in virtualenv, a tool for creating isolated Python virtual environments that is bundled in a number of Red Hat offerings, including Red Hat Enterprise Linux, Red Hat OpenShift AI, and other layered products and containers, as well as in Fedora and EPEL community builds. Red Hat rates this flaw as having Moderate impact. virtualenv writes prompt values verbatim into the line-oriented pyvenv.cfg file, while its reader parses the file with str.splitlines() and accepts the last value for duplicate keys. An attacker who can influence prompt input -- the --prompt command-line option, the VIRTUALENV_PROMPT environment variable, or a configuration-derived value such as a CI job templating an untrusted branch name -- can inject line boundaries and additional configuration keys, including home, into the generated pyvenv.cfg. Because tooling reads home to locate the base interpreter, a consumer that trusts the file can be redirected to an attacker-selected interpreter, potentially resulting in arbitrary code execution or environment tampering when the virtual environment is used. Exploitation requires the prompt value to come from outside the operator's trust boundary: where the operator supplies the prompt directly, they already control the command line, and the effect is corruption of their own environment rather than privilege gain. This is why Red Hat assesses the impact as Moderate, while the upstream project published the advisory with low severity. Fixes for affected Red Hat products and streams are being pursued by the responsible component and product teams under delegated resolution; some community and out-of-support-scope streams will not receive an update.

Red Hat's mitigation

Strip line boundaries (such as newline, carriage return, and other Unicode line-separator characters) from any value before using it as --prompt or VIRTUALENV_PROMPT, and do not pass externally influenced data -- for example user-supplied strings or CI-derived values such as branch names -- as the virtualenv prompt. Ensure the VIRTUALENV_PROMPT environment variable and any configuration file that sets the prompt are sourced only from trusted input. The upstream project fixed this issue in virtualenv 21.7.11 by collapsing line boundaries when writing pyvenv.cfg, so updating to a version that contains this fix resolves the issue. For Red Hat products that bundle virtualenv, apply updates through the respective product channels.

ProductPackageStateAdvisory
Red Hat Ansible Automation Platform 2.6ansible-automation-platform-26/eda-controller-rhel9:1791945282Fixed 2026-10-21RHSA-2026:87120
Red Hat Ansible Automation Platform 2.6ansible-automation-platform-26/lightspeed-chatbot-rhel9:1791978798Fixed 2026-10-21RHSA-2026:87120
Red Hat Ansible Automation Platform 2.7ansible-automation-platform-27/eda-controller-rhel9:1792141010Fixed 2026-10-21RHSA-2026:87124
Red Hat OpenShift AI 2.25rhoai/odh-feature-server-rhel9:1792148523Fixed 2026-10-21RHSA-2026:87410
Red Hat OpenShift AI 2.25rhoai/odh-ta-lmes-job-rhel9:1791553527Fixed 2026-10-21RHSA-2026:87410
Red Hat OpenShift AI 3.4rhoai/odh-feature-server-rhel9:1791863220Fixed 2026-10-19RHSA-2026:84734
Red Hat OpenShift AI 3.4rhoai/odh-kserve-agent-rhel9:1791468381Fixed 2026-10-19RHSA-2026:84734
Red Hat OpenShift AI 3.4rhoai/odh-kserve-controller-rhel9:1791468368Fixed 2026-10-19RHSA-2026:84734
Red Hat OpenShift AI 3.4rhoai/odh-kserve-router-rhel9:1791468401Fixed 2026-10-19RHSA-2026:84734
Red Hat OpenShift AI 3.4rhoai/odh-kserve-storage-initializer-rhel9:1790958549Fixed 2026-10-19RHSA-2026:84734
OpenShift Lightspeedopenshift-lightspeed/lightspeed-service-api-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/ansible-dev-tools-rhel8Out of support scope
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/ansible-dev-tools-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/controller-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/ansible-devspaces-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/ansible-dev-tools-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/controller-rhel9Affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-tech-preview/ansible-devspaces-rhel9Affected
Red Hat Ansible Automation Platform 2python3.11-virtualenvAffected
Red Hat Ansible Automation Platform 2python3.12-virtualenvAffected
32 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-102938.

Attack patterns (CAPEC)

  • CAPEC-15 Command Delimiters Likelihood: High · Severity: High
  • CAPEC-81 Web Server Logs Tampering Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON