Miggo Logo

GHSA-pqhf-p39g-3x64: uv allows ZIP payload obfuscation through parsing differentials

N/A

CVSS Score

Basic Information

CVE ID
-
EPSS Score
-
Published
10/29/2025
Updated
10/29/2025
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
uvpip<= 0.9.50.9.6

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability lies in how uv processes ZIP archives, which is a core part of its functionality for installing Python packages. The analysis of the patch da659fee4898a73dbc75070f3e82d49f745e4628 reveals two main points of failure that were fixed.

First, the async_zip dependency was updated. The commit for the new revision in the forked repository astral-sh/rs-async-zip has a message indicating it fixes handling of ZIP entry comments. This directly corresponds to the first issue described in the advisory, where uv would misinterpret comment fields in the ZIP's central directory. This part of the vulnerability is within the async_zip dependency.

Second, uv's own code was changed to add validation for filenames within the archive. A new function, validate_archive_member_name, was introduced in crates/uv-extract/src/lib.rs to check for empty filenames and control characters (like null bytes). This addresses the second issue from the advisory, where uv handled filenames with null bytes differently from other tools like Python's zipfile module.

The vulnerable functions are the ones that orchestrate the ZIP extraction process, as they were the entry points for the vulnerable logic. These are uv_extract::stream::unzip (for async extraction) and uv_extract::sync::unzip (for sync extraction). Both functions were modified to call the new validate_archive_member_name function. Before the patch, these functions would extract files from ZIP archives without proper validation, making them vulnerable to the described parsing differentials. An attacker could exploit this by crafting a malicious wheel or source distribution in a ZIP format, which, when installed with uv pip install, could lead to unexpected behavior and potentially arbitrary code execution.

Vulnerable functions

uv_extract::stream::unzip
crates/uv-extract/src/stream.rs
This asynchronous function is responsible for unpacking ZIP archives. Before the patch, it did not validate filenames for malicious characters (like null bytes) and used a version of the `async_zip` library that incorrectly handled comments in ZIP central directory entries. This could lead to a parsing differential where a specially crafted ZIP file is interpreted differently by `uv` compared to other tools, potentially leading to the execution of malicious code during package installation.
uv_extract::sync::unzip
crates/uv-extract/src/sync.rs
This function is the synchronous version for unpacking ZIP archives. Similar to its async counterpart, it was vulnerable because it did not validate filenames for malicious characters and relied on a vulnerable version of a ZIP parsing library. An attacker could craft a ZIP file that would be processed insecurely by this function.

WAF Protection Rules

WAF Rule

### Imp**t In v*rsions *.*.* *n* **rli*r o* uv, ZIP *r**iv*s w*r* **n*l** in * m*nn*r t**t *n**l** two p*rsin* *i***r*nti*ls ***inst ot**r *ompon*nts o* t** Pyt*on p**k**in* **osyst*m: *. **ntr*l *ir**tory *ntri*s in * ZIP *r**iv* **n *ont*in *omm*

Reasoning

T** vuln*r**ility li*s in *ow `uv` pro**ss*s ZIP *r**iv*s, w*i** is * *or* p*rt o* its *un*tion*lity *or inst*llin* Pyt*on p**k***s. T** *n*lysis o* t** p*t** `****************************************` r*v**ls two m*in points o* **ilur* t**t w*r* *ix