CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-102938

CVE-2026-102938: Configuration Injection and Local Execution Hijack in virtualenv

Alon Barad
Alon Barad
Software Engineer

Oct 1, 2026·6 min read·32 visits

Executive Summary (TL;DR)

virtualenv prior to 21.7.11 is vulnerable to configuration injection. By injecting unicode line-boundary characters into the prompt configuration parameter, an attacker can override the home configuration key, redirecting downstream python executions to a malicious binary.

An input validation vulnerability in the virtualenv package allows local execution hijacking via configuration injection. When generating the pyvenv.cfg configuration file, user-controlled parameters such as prompt options are written verbatim without sanitizing line-boundary sequences. This allows attackers to inject arbitrary configuration options, causing the tool to read malicious base interpreter paths.

Vulnerability Overview & Attack Surface

The Python virtualenv tool isolates dependencies by generating standalone virtual environments, each containing its own package repository and configuration metadata. The core configuration is maintained in a flat, line-delimited key-value configuration file named pyvenv.cfg located in the root of each virtual environment.

This configuration file dictates parameters such as the environment's base interpreter directory, system package access, and the active environment prompt string. The vulnerability surfaces when virtualenv processes user-controlled parameter values, including --prompt or environment variables, during initialization.

Prior to version 21.7.11, virtualenv did not validate or sanitize line boundaries in these user-defined configuration fields. This oversight creates an attack surface where a local attacker or automated process supplying parameters can inject configuration directives, resulting in unauthorized control over the environment's execution parameters.

Root Cause & Parser Weaknesses

The root cause of CVE-2026-102938 lies in a mismatch between how configuration parameters are serialized to disk and how they are parsed during read operations. When generating the environment, the PyEnvCfg.write() method writes prompt strings and other parameters directly to pyvenv.cfg without validating the absence of line boundaries.

Conversely, when reading these configurations, the parser PyEnvCfg._read_values() reads the raw text and utilizes Python's built-in str.splitlines() method to isolate lines. Python's str.splitlines() function is designed to handle multiple Unicode newline boundaries. It splits strings on ten distinct character sequences, including line feed \n, carriage return \r, vertical tab \v, form feed \f, unit separators, next line \x85, and Unicode paragraph separators.

By injecting any of these ten recognized characters into a prompt configuration field, an attacker can prematurely terminate the current configuration entry and introduce new, independent lines. Because virtualenv parses files sequentially and retains the last encountered value for duplicate keys, an attacker can append a second home directive. This overrides the legitimate base directory path defined earlier in the file.

Code Path and Patch Analysis

Let us examine the differences in the implementation of the configuration serialization between vulnerable and fixed releases. In vulnerable versions of virtualenv, configuration parameters are written sequentially without validation.

# Vulnerable serialization in PyEnvCfg.write()
def write(self):
    with open(self.path, "w", encoding="utf-8") as f:
        for key, value in self.values.items():
            # Values are written directly, allowing embedded newlines to escape
            f.write(f"{key} = {value}\n")

To address this security flaw, the maintainers introduced a strict sanitization helper called _one_line inside src/virtualenv/create/pyenv_cfg.py. This utility matches all ten Unicode line-terminating sequences recognized by the interpreter's splitting logic and replaces them with a single space character, neutralizing potential configuration injections.

# Patched implementation in virtualenv 21.7.11
from typing import Final
 
_LINE_BOUNDARIES: Final[tuple[str, ...]] = (
    "\n",
    "\r",
    "\v",
    "\f",
    "\x1c",
    "\x1d",
    "\x1e",
    "\x85",
    chr(0x2028),  # Unicode line separator
    chr(0x2029),  # Unicode paragraph separator
)
 
def _one_line(text: str) -> str:
    """Replaces line boundaries with a space to prevent configuration injection."""
    for boundary in _LINE_BOUNDARIES:
        text = text.replace(boundary, " ")
    return text
 
# Secure writing inside PyEnvCfg.write()
# Applying the validation function to both keys and values prevents line escapes
line = f"{_one_line(key)} = {_one_line(normalized_value)}"

This defensive approach is robust because it directly mirrors the line-splitting logic of str.splitlines(). By neutralizing the exact set of delimiters parsed as new lines, the patch guarantees that a value cannot be structured to define multiple config attributes.

Exploitation Vector & Execution Flow Hijacking

The exploitation flow depends on an attacker's ability to influence the configuration parameters of a virtual environment during its initialization phase. This vector is relevant in automated contexts, such as multi-tenant hosting platforms or CI/CD pipelines where repository names or branches are used to populate the environment's prompt string.

To initiate the attack, the adversary passes a crafted argument to the --prompt CLI flag, containing an inline carriage return or line separator followed by a spoofed home key. When the file is written, the raw byte sequence formats the configuration file such that the parser interprets it as two separate attributes.

home = /usr/bin
include-system-site-packages = false
version = 3.10.12
prompt = isolated_env
home = /tmp/attacker_controlled_binaries
prompt = final_stub

When a downstream agent executes the Python virtual environment, the loader parses pyvenv.cfg. The second home entry is read last, overriding the legitimate path. The loader then redirects directory searches for core library dependencies and interpreter execution to /tmp/attacker_controlled_binaries, executing a payload.

Impact Assessment & Threat Context

The impact of CVE-2026-102938 is focused on environment integrity and local privilege execution control. An attacker who successfully hijacks the virtual environment's configuration can execute arbitrary binaries whenever the environment is activated or called by automated build steps.

This vector is relevant in cloud build servers and continuous integration systems. In these environments, automated tasks often generate virtual environments programmatically using input derived from unverified external Git commit metadata, tags, or pull request payloads. This enables remote injection vectors leading to execution context hijacking.

According to the CVSS v4.0 evaluation, the vulnerability carries a score of 5.8 with local attack vector characteristics. The rating reflects low confidentiality impact, but high integrity impact due to the redirection of the virtual environment's underlying Python execution framework.

Remediation & Detection Strategies

Remediating CVE-2026-102938 requires updating the virtualenv library across all build hosts, local environments, and orchestration servers. The maintainers have addressed the issue in version 21.7.11 and all subsequent releases.

For systems where an immediate upgrade is unfeasible, developers should enforce strict input filtering of configuration strings in wrapper scripts. Scripts invoking virtualenv must sanitize input variables to strip the ten recognized Unicode line boundaries before passing parameters to the command line.

Security teams can identify compromised environments by scanning systems for anomalous configuration layouts. A validation tool can read pyvenv.cfg files and verify that critical parameters like home are not defined multiple times within the configuration file, signaling an ongoing injection attempt.

Official Patches

pypaPull Request to implement line boundary sanitization for pyvenv.cfg values

Fix Analysis (1)

Technical Appendix

CVSS Score
5.8/ 10
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 Probability
0.04%
Top 100% most exploited

Affected Systems

Python environments utilizing virtualenv configurationsCI/CD build pipelines and automated testing hosts executing virtualenv creation scripts

Affected Versions Detail

Product
Affected Versions
Fixed Version
virtualenv
pypa
< 21.7.1121.7.11
AttributeDetail
CWE IDCWE-93
Attack VectorLocal
CVSS v4.0 Score5.8
EPSS Score0.00043
ImpactHigh Integrity, Low Confidentiality, Low Availability
Exploit Statusnone
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1574Hijack Execution Flow
Persistence / Privilege Escalation / Defense Evasion
T1059.006Command and Scripting Interpreter: Python
Execution
T1546Event Triggered Execution
Execution / Persistence
CWE-93
Improper Neutralization of CRLF Sequences ('CRLF Injection')

The application copies an input string containing CRLF or other line-delimiter characters into a line-oriented output stream or file without sanitization, allowing the alteration of the logical structure.

Vulnerability Timeline

Vulnerability reported to virtualenv maintainers
2026-09-16
Maintainers commit fix and publish version 21.7.11
2026-09-17
GitHub Advisory and CVE details publicly disclosed
2026-09-29

References & Sources

  • [1]GHSA-9h9j-4vrj-gf7g Advisory
  • [2]NVD CVE-2026-102938 Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 15 hours ago•CVE-2026-128087
3.7

CVE-2026-128087: Premature Key Exchange Callback Invocation Prior to Host Key Verification in russh

CVE-2026-128087 (GHSA-9264-jvgf-6w2f) is an incorrect behavior order (CWE-696) and improper authorization (CWE-863) vulnerability in the russh Rust SSH library, affecting versions 0.55.0 through 0.65.0. During the initial SSH key exchange (KEX) handshake, the client state machine invokes the client::Handler::kex_done() callback—providing the negotiated raw shared secret bytes—prior to validating the remote server's host key or certificate via check_server_key(). Consequently, an untrusted or rogue SSH server can complete cryptographic key agreement and force a connecting client to execute side-effecting application logic inside kex_done() before the server's identity is checked and rejected.

Amit Schendel
Amit Schendel
4 views•10 min read
•about 16 hours ago•CVE-2026-128082
7.5

CVE-2026-128082: Uncontrolled Recursion and Denial of Service in AutoMapper via Constructor Parameter Mapping

CVE-2026-128082 (GHSA-6vhm-j9h7-f9gh) is an uncontrolled recursion vulnerability (CWE-674) in AutoMapper, a convention-based object-object mapper for .NET. When mapping nested or self-referential types into destination models that rely on parameterized constructors, C# positional records, or recursive ConstructUsing expressions, AutoMapper evaluates child constructor arguments prior to incrementing the parent's recursion depth counter. This ordering flaw bypasses both explicit MaxDepth limits and the default depth limit of 64. An unauthenticated remote attacker can supply deeply nested input payloads to affected endpoints, exhausting the thread call stack and triggering an uncatchable System.StackOverflowException that terminates the hosting .NET process.

Amit Schendel
Amit Schendel
7 views•11 min read
•about 17 hours ago•CVE-2026-128080
5.8

CVE-2026-128080: Sensitive Query Parameter Disclosure on Incoming Server Spans in OpenTelemetry JavaScript (@opentelemetry/instrumentation-http)

An information exposure vulnerability in the @opentelemetry/instrumentation-http package for OpenTelemetry JavaScript versions 0.204.0 prior to 0.222.0 causes incoming HTTP server spans to record raw, unredacted query string parameters under the url.query attribute. While outgoing client spans applied built-in and user-configured query parameter redaction, incoming server spans bypassed this sanitization completely, resulting in the transmission of sensitive credentials such as pre-signed cloud URLs and API tokens to external observability backends.

Alon Barad
Alon Barad
6 views•10 min read
•about 18 hours ago•CVE-2026-128089
7.5

CVE-2026-128089: Uncontrolled Resource Consumption in dnspython WKS Record Parser

CVE-2026-128089 is an uncontrolled resource consumption vulnerability in the dnspython toolkit for Python, affecting all versions prior to 2.9.2. When parsing Well-Known Service (WKS) records from text via dns.rdtypes.IN.WKS.WKS.from_text(), the parser fails to validate that numeric service port identifiers fall within the RFC 1035 valid range of 0 through 65535. An attacker capable of supplying untrusted zone files or RDATA text strings containing an arbitrarily large service port integer can force the parser to allocate an unbounded bitmap array using an inefficient linear append loop, resulting in severe CPU exhaustion, application hangs, or Out-Of-Memory (OOM) process termination.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 19 hours ago•CVE-2026-126347
3.1

CVE-2026-126347: Open Redirect via Triple-Slash Redirect Paths in Tornado RedirectHandler

CVE-2026-126347 (GHSA-5cjw-f85j-cv6r) is an open redirect vulnerability (CWE-601) in Tornado, an asynchronous Python networking library and web framework. The flaw resides in tornado.web.RedirectHandler when dynamic URL redirection templates incorporate unvalidated user input. Due to a parser differential between RFC 3986 (used by Python's urllib.parse.urlsplit) and the WHATWG URL Standard (used by modern web browsers), inputs containing three or more leading slashes bypass Tornado 6.6.0's validation logic, allowing unauthenticated attackers to redirect users to arbitrary external domains.

Alon Barad
Alon Barad
7 views•11 min read
•about 20 hours ago•CVE-2026-128123
5.9

CVE-2026-128123: Uncaught Exception and Denial of Service in SvelteKit @sveltejs/adapter-node

A Denial of Service (DoS) vulnerability exists in @sveltejs/adapter-node versions 5.5.7 and 6.0.0-next.0 through 6.0.0. When a SvelteKit server route returns a direct response from a fetch() call with a Content-Type of text/event-stream, the Node.js adapter attempts to mutate the response headers to disable proxy buffering. Because headers returned directly by the WHATWG Fetch API carry an immutable guard, this mutation throws an unhandled TypeError, terminating the underlying Node.js process and denying service to all active and subsequent clients.

Alon Barad
Alon Barad
5 views•9 min read