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-113720

CVE-2026-113720: Local Permission Inheritance Vulnerability in virtualenv

Amit Schendel
Amit Schendel
Senior Security Researcher

Oct 24, 2026·5 min read·12 visits

Executive Summary (TL;DR)

virtualenv < 21.14.9 uses shutil.copy() when seeding environments from the app-data cache, preserving original file modes and bypassing process umask. If the cache was populated under a loose umask, resulting virtual environment files may remain world- or group-writable, allowing local privilege escalation via code injection.

virtualenv prior to version 21.14.9 contains a local permission inheritance vulnerability in its app-data copy seeder. Due to the reliance on Python's standard shutil.copy() function, permissions from cached packages are replicated directly onto newly created virtual environment files, ignoring the active process umask and allowing unprivileged local attackers to inject code.

Vulnerability Overview

virtualenv is a standard utility in Python ecosystem workflows used to create isolated execution environments. To minimize overhead and network operations during setup, virtualenv utilizes an app-data disk cache that stores pre-downloaded wheel files and seed packages.

When creating new environments, virtualenv copies these cached artifacts into the destination directory structure. Prior to version 21.14.9, the copy mechanism preserved the exact file permission mode bits (stat.st_mode) of the cached source files. This design ignored the current process's file creation mask (umask).

If the centralized app-data cache was populated when a loose umask (e.g., 000 or 002) was active, cached files inherited permissive file mode bits such as 0666 or 0777. When subsequent environments were constructed, these permissive mode bits were retained on executable scripts and package modules, exposing the virtual environment to unauthorized local modifications.

Root Cause Analysis

The root cause stems from reliance on shutil.copy() and shutil.copytree() in virtualenv's synchronization logic (src/virtualenv/util/path/_sync.py). Under POSIX systems, shutil.copy() delegates mode setting to shutil.copymode(), which explicitly reads the source file's st_mode and applies it to the target file via os.chmod().

# Vulnerable path handling prior to 21.14.9
def copy(src: Path, dest: Path) -> None:
    LOGGER.debug("copy %s", _Debug(src, dest))
    method = copytree if src.is_dir() else shutil.copy
    method(str(src), str(dest))

By executing shutil.copymode(), virtualenv explicitly overrode the operating system's normal process file creation mask behavior. Files created with standard file-creation syscalls respect the active process umask by calculating mode & ~umask. In contrast, shutil.copymode() retroactively applies permission bits directly from the source stat structure.

This architecture created a cross-context permission leak. The security boundary of a newly created virtual environment was bound to the permissions of historical cache generation rather than the calling process's active system policy.

Code Analysis & Fix Verification

To resolve the vulnerability in commit 35f0b33562790176dd186d0a3c517af3acc7a0e1, the maintainers eliminated standard shutil.copy() calls in favor of a low-level custom file transfer routine _copy_file().

# Fixed copy implementation in src/virtualenv/util/path/_sync.py
def _copy_file(src: Path, dest: Path) -> None:
    ensure_safe_to_do(src, dest)
    mode: Final = 0o755 if src.stat().st_mode & (S_IXUSR | S_IXGRP | S_IXOTH) else 0o644
    flags: Final = os.O_WRONLY | os.O_CREAT | os.O_EXCL | (os.O_BINARY if os.name == "nt" else 0)
    # Creation applies the current umask without changing the process-wide setting.
    with src.open("rb") as source, os.fdopen(os.open(str(dest), flags, mode), "wb") as target:
        shutil.copyfileobj(source, target, length=1024 * 1024)

The fix establishes base permission defaults of 0o755 for executable source files and 0o644 for regular files. It then invokes os.open() with os.O_CREAT | os.O_EXCL, allowing the kernel's native file creation mechanism to apply the active process umask directly against these base permission modes.

In addition, enforcing os.O_EXCL prevents symlink redirection attacks during target environment creation. If a file or symlink already exists at the destination path, the file creation operation aborts instantly.

Exploitation Methodology

Exploitation requires multi-user context on a local system where virtual environments are created in shared or traversable directory locations, such as /tmp or shared project spaces.

An attacker identifies a target environment containing group- or world-writable files (such as /tmp/env/lib/python3.X/site-packages/pip/__init__.py). The attacker appends arbitrary Python code to the file.

When the victim executes pip or invokes Python within the target virtual environment, the modified module is imported and executed within the security context of the victim account.

Impact & Risk Analysis

Successful exploitation grants a local attacker code execution under the privileges of the target environment's owner. If the target user possesses higher privilege or access to sensitive credentials, the attacker can hijack those session rights.

Under CVSS v4.0 metrics, the vulnerability yields a base score of 4.4 (CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N). Integrity impact on the vulnerable system is evaluated as High due to full modification rights over Python executable packages.

The attack vector is restricted to local system access, and attack complexity is classified as High because specific environment caching and filesystem permissions conditions must be satisfied prior to creation.

Remediation & Mitigation Guidance

The primary remediation strategy is upgrading virtualenv to version 21.14.9 or later, which enforces process umask evaluation during file creation.

To audit and remediate existing virtual environments created by vulnerable versions, administrators should scan for overly permissive files in active virtual environment paths.

# Identify world-writable files inside a target virtual environment
find /path/to/venv -type f -perm -0002 -exec ls -l {} +
 
# Correct permissions across an existing environment
find /path/to/venv -type d -exec chmod 755 {} +
find /path/to/venv -type f -exec chmod 644 {} +
find /path/to/venv/bin -type f -exec chmod 755 {} +

Official Patches

pypaPull Request #3425: Enforce system umask during app-data seeding
pypaRelease tag 21.14.9

Fix Analysis (1)

Technical Appendix

CVSS Score
4.4/ 10
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N
EPSS Probability
0.10%
Top 100% most exploited

Affected Systems

virtualenv < 21.14.9

Affected Versions Detail

Product
Affected Versions
Fixed Version
virtualenv
pypa
< 21.14.921.14.9
AttributeDetail
Vulnerability IDCVE-2026-113720
CWE IDCWE-732 (Incorrect Permission Assignment for Critical Resource)
CVSS v4.0 Score4.4 (Medium)
CVSS VectorCVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N
Attack VectorLocal
Exploit StatusNo public weaponized exploit available
CISA KEV StatusNot listed
Patched Version21.14.9

MITRE ATT&CK Mapping

T1222File and Directory Permissions Modification
Defense Evasion
CWE-732
Incorrect Permission Assignment for Critical Resource

The software specifies permissions for a security-critical resource in a way that allows unintended access to that resource.

Vulnerability Timeline

Fix commit 35f0b33562790176dd186d0a3c517af3acc7a0e1 committed in PR #3425
2026-10-17
virtualenv version 21.14.9 published to PyPI
2026-10-20
GitHub Security Advisory GHSA-fc2g-4w5p-6whm published
2026-10-20
CVE-2026-113720 published
2026-10-20

References & Sources

  • [1]GitHub Security Advisory GHSA-fc2g-4w5p-6whm
  • [2]NIST NVD CVE-2026-113720 Detail
  • [3]CVE.org CVE-2026-113720 Record
  • [4]virtualenv Pull Request #3425
  • [5]virtualenv Commit 35f0b33562790176dd186d0a3c517af3acc7a0e1
  • [6]virtualenv Release 21.14.9

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

•14 minutes ago•CVE-2026-126300
5.3

CVE-2026-126300: Algorithmic Complexity Denial of Service in NLTK TreebankWordTokenizer.span_tokenize

CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.

Amit Schendel
Amit Schendel
0 views•10 min read
•about 1 hour ago•GHSA-GPWC-27CW-RH9R
5.3

CVE-2026-126301: Quadratic CPU Exhaustion in NLTK LegalitySyllableTokenizer

The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.

Amit Schendel
Amit Schendel
2 views•10 min read
•about 2 hours ago•CVE-2026-126304
8.7

CVE-2026-126304: Symlink Path Traversal in NLTK YCOECorpusReader

CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.

Amit Schendel
Amit Schendel
4 views•9 min read
•about 3 hours ago•CVE-2026-128077
6.5

CVE-2026-128077: Authorization Bypass via Request Path Desynchronization in Nuxt and @nuxt/nitro-server

CVE-2026-128077 (GHSA-r99w-jh2x-3mg9) is an authorization bypass and interpretation conflict vulnerability affecting Nuxt and its underlying @nuxt/nitro-server package in versions 4.6.0 through 4.6.3. When an incoming HTTP request path begins with a double forward slash (e.g., //x/admin), the WHATWG URL parser within the Nuxt server-side page renderer interprets the initial segment as a network host/authority and resolves the remaining path (/admin) against the application's page router. Because Nitro server middleware, route-scoped serverHandlers, and Nitro routeRules evaluate the unparsed request path (//x/admin), path-based access controls, redirects, and security header policies configured for /admin fail to match and are bypassed.

Amit Schendel
Amit Schendel
5 views•10 min read
•about 4 hours ago•CVE-2026-128084
4.8

CVE-2026-128084: Integer Truncation and SQL Query Truncation in sqlite3-ruby

Prior to version 2.10.2, the sqlite3-ruby gem explicitly cast 64-bit Ruby string lengths (long) to 32-bit signed integers (int) when invoking the underlying SQLite C API. On 64-bit platforms, providing a string of 4 GiB (2^32 bytes) or larger causes integer truncation, instructing SQLite to process only a prefix of the string. This flaw affects SQL query preparation, bound parameter values, and return values from custom Ruby-defined SQL functions and aggregates, allowing trailing SQL clauses such as WHERE restrictions to be silently dropped under specific conditions.

Alon Barad
Alon Barad
5 views•11 min read
•about 5 hours ago•CVE-2026-128068
5.3

CVE-2026-128068: Regular Expression Denial of Service in rails-html-sanitizer

CVE-2026-128068 (GHSA-cpgf-5mjf-73p7) is a Regular Expression Denial of Service (ReDoS) vulnerability in the rails-html-sanitizer Ruby gem affecting versions 1.0.3 through 1.7.1. The flaw resides in the Rails::HTML::PermitScrubber#scrub_attribute method, which uses the multiline regular expression /^\s*[^#\s].*/m to enforce local-only URI fragment references on SVG elements. On Ruby runtimes prior to version 3.2 (CRuby <= 3.1 and JRuby), evaluating an attribute value composed of repeated newline and whitespace characters without a hash character triggers quadratic backtracking O(n^2). Applications are only vulnerable if their sanitization allowlist is explicitly configured to permit SVG reference elements such as <use> alongside href or xlink:href attributes.

Alon Barad
Alon Barad
6 views•9 min read