Skip to main content
Vulnerability Database/CVE-2025-54368

CVE-2025-54368: uv Python Package Manager Path Traversal

CVE-2025-54368 is a path traversal vulnerability in uv Python package manager that allows attackers to exploit ZIP archive handling flaws. This post covers the technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-54368 Overview

CVE-2025-54368 affects uv, a Python package and project manager written in Rust developed by Astral. In versions 0.8.5 and earlier, remote ZIP archives are processed in a streamwise fashion without reconciling file entries against the archive's central directory. An attacker can craft a ZIP archive that extracts legitimate contents on some package installers while delivering malicious contents on uv, or construct a "stacked" ZIP containing multiple internal archives. The attacker chooses which installer to target, enabling wheel archive confusion attacks against Python supply chains. The issue is fixed in version 0.8.6.

Critical Impact

Attackers can smuggle malicious payloads into Python wheel installations by exploiting parser disagreement between uv and other installers like pip, enabling targeted supply chain compromise.

Affected Products

  • Astral uv versions 0.8.5 and earlier
  • Python environments provisioned via uv pip install from remote wheel sources
  • CI/CD pipelines and container builds that rely on uv for Python dependency resolution

Discovery Timeline

  • 2025-08-08 - CVE-2025-54368 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-54368

Vulnerability Analysis

The vulnerability is a parser confusion issue classified as [CWE-20] Improper Input Validation. uv reads ZIP wheel archives in a streaming manner, trusting the sequence of local file headers rather than validating them against the central directory record. ZIP format tolerates multiple local file entries sharing the same filename, and different parsers resolve the ambiguity differently.

An attacker publishes a wheel whose first local entry contains benign Python code and a second entry overrides it with malicious code. Installers that honor the central directory extract one version; uv extracts the other. A second variant embeds multiple complete ZIP structures within one file, allowing the attacker to decide which installer sees which payload. This enables targeted supply chain attacks where only uv users receive the malicious variant, evading analysis performed with pip or other tooling.

Root Cause

The async_zip Rust crate used by uv processed ZIP entries sequentially from the stream without deduplication or central directory reconciliation. Malformed archives containing repeated entries or stacked archives were accepted silently rather than rejected.

Attack Vector

Exploitation requires user interaction, specifically installing a crafted wheel from a repository the attacker can publish to, such as PyPI or an internal index. The attack vector is local in that it executes during the install step on the developer or build host, with high integrity impact on the resulting Python environment.

text
// Patch reference - Cargo.lock dependency bump
 [[package]]
 name = "async_zip"
 version = "0.0.17"
-source = "git+https://github.com/astral-sh/rs-async-zip?rev=c909fda63fcafe4af496a07bfda28a5aae97e58d#c909fda63fcafe4af496a07bfda28a5aae97e58d"
+source = "git+https://github.com/astral-sh/rs-async-zip?rev=285e48742b74ab109887d62e1ae79e7c15fd4878#285e48742b74ab109887d62e1ae79e7c15fd4878"
 dependencies = [
  "async-compression",
  "crc32fast",

Source: GitHub commit 7f1eaf4. The patch hardens ZIP streaming to reject repeated entries and other malformed ZIP files.

Detection Methods for CVE-2025-54368

Indicators of Compromise

  • Wheel (.whl) files containing duplicate local file headers for the same filename within a single archive.
  • Wheel files whose extracted contents differ between uv and pip when installed in isolated environments.
  • Presence of concatenated or stacked ZIP structures inside a single .whl payload.
  • Installation of uv binaries at version 0.8.5 or earlier in production or CI environments.

Detection Strategies

  • Scan wheel caches and artifact repositories with ZIP validators that compare local file headers against the central directory and flag mismatches.
  • Audit CI job logs for uv version strings and alert on any invocation at or below 0.8.5.
  • Compare file hashes of installed Python packages against known-good hashes published by the upstream project.

Monitoring Recommendations

  • Monitor process execution for uv pip install or uv sync commands that pull from untrusted or newly added indexes.
  • Track outbound network connections from build agents to non-approved package registries.
  • Alert on new or unexpected Python modules writing to disk shortly after a uv install operation.

How to Mitigate CVE-2025-54368

Immediate Actions Required

  • Upgrade uv to version 0.8.6 or later across all developer workstations, CI runners, and container base images.
  • Inventory wheel archives downloaded by uv before the upgrade and rebuild Python environments from a trusted installer to confirm consistent contents.
  • Ensure the UV_INSECURE_NO_ZIP_VALIDATION environment variable is not set to 1 in any environment.

Patch Information

The fix shipped in uv 0.8.6 via commit 7f1eaf4, which updates the vendored async_zip dependency to a hardened revision that rejects repeated ZIP entries and malformed archives. See the Astral Blog Security Advisory and GitHub Security Advisory GHSA-8qf3-x8v5-2pj8 for full details. Additional context on the broader attack class is available in the PyPI blog post on wheel archive confusion attacks.

Workarounds

  • If upgrading is not immediately possible, restrict uv to pulling from a private, curated index that validates uploaded wheels against central directory consistency.
  • Pin wheel installations to known hashes using a lockfile and verify hashes at install time.
  • Do not use UV_INSECURE_NO_ZIP_VALIDATION=1; this reverts to the vulnerable behavior and is documented only as a last-resort escape hatch.
bash
# Upgrade uv to the patched version
uv self update
uv --version   # confirm >= 0.8.6

# Ensure the insecure override is not set
unset UV_INSECURE_NO_ZIP_VALIDATION

# Install with hash verification against a lockfile
uv pip install --require-hashes -r requirements.txt

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.