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

CVE-2025-71437: Astral uv Path Traversal Vulnerability

CVE-2025-71437 is a path traversal flaw in Astral uv that allows attackers to write arbitrary files outside the installation prefix through malicious sdist packages. This post covers technical details, affected versions, impact, and mitigation.

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-71437 Overview

CVE-2025-71437 is a path traversal vulnerability [CWE-22] in Astral uv, a high-performance Python package installer and resolver written in Rust. Versions prior to 0.8.22 improperly handle symbolic links during source distribution (sdist) tar extraction. A specially crafted sequence of symlinks inside an sdist archive can redirect file writes outside the intended extraction prefix. An attacker who publishes a malicious sdist to a package index can write arbitrary files to the victim's filesystem when the package is installed.

Critical Impact

Arbitrary file write outside the installation prefix during uv package installation enables persistence, configuration tampering, and potential code execution through overwritten startup files.

Affected Products

  • Astral uv versions prior to 0.8.22
  • Python environments and CI/CD pipelines that install sdist packages via uv
  • Developer workstations using uv pip install or uv add against untrusted indices

Discovery Timeline

  • 2026-10-21 - CVE-2025-71437 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2025-71437

Vulnerability Analysis

Astral uv extracts Python source distributions by unpacking tar archives into a target installation prefix. The extraction logic fails to fully validate symbolic link targets before writing subsequent archive entries. When an archive contains an attacker-controlled symlink that points outside the extraction directory, follow-on file writes dereference that symlink and land on arbitrary filesystem paths.

This class of flaw is commonly called a "symlink-based tar slip." The sdist format permits arbitrary file entries including symlinks, and the Python packaging ecosystem does not sign or verify sdist contents by default. A malicious maintainer, or an attacker who compromises an upstream package, can weaponize this to breach the containment boundary of the extraction prefix.

Root Cause

The root cause is insufficient validation of symlink entries and their resolved targets during tar extraction. The extractor processes archive entries sequentially and does not verify that the final resolved write path remains inside the intended prefix after symlink resolution.

Attack Vector

Exploitation requires a victim to install a crafted sdist with uv. The attack vector is network-based because sdists are typically fetched from PyPI or a private index. No authentication or user interaction beyond a routine uv pip install <package> command is required. Successful exploitation writes files to paths such as ~/.bashrc, ~/.ssh/authorized_keys, or systemd unit directories, depending on process privileges.

The vulnerability is described in prose only; refer to the GitHub Security Advisory GHSA-7j9j-68r2-f35q and the VulnCheck Advisory on Astral uv path traversal for technical specifics.

Detection Methods for CVE-2025-71437

Indicators of Compromise

  • Unexpected file writes outside Python virtual environment prefixes immediately following uv installation activity.
  • Modifications to shell startup files (.bashrc, .zshrc, .profile), SSH configuration, or cron entries during package install windows.
  • sdist archives containing symbolic link entries with targets that resolve above the extraction root.
  • uv process versions below 0.8.22 observed in build pipelines or developer endpoints.

Detection Strategies

  • Inventory the installed uv version across developer workstations and CI runners; flag any version below 0.8.22.
  • Inspect downloaded sdist archives with tar -tvf to enumerate symlink entries and verify their targets stay within the archive root.
  • Correlate process telemetry for uv with file-write events outside the target virtual environment directory.

Monitoring Recommendations

  • Log all package installation events in CI/CD and alert on sdist installs from unpinned or untrusted sources.
  • Monitor sensitive paths (~/.ssh/, /etc/, systemd unit directories, shell rc files) for modifications originating from Python packaging tooling.
  • Enable file integrity monitoring on build agents and treat any uv-initiated write outside the project directory as suspicious.

How to Mitigate CVE-2025-71437

Immediate Actions Required

  • Upgrade uv to version 0.8.22 or later on every workstation, container image, and CI/CD runner.
  • Audit recent sdist installations performed by vulnerable uv versions and review for unexpected files outside project prefixes.
  • Prefer wheels (.whl) over sdists where possible by setting --only-binary=:all: or equivalent policy for untrusted dependencies.
  • Pin and hash-verify dependencies to prevent silent substitution of a malicious sdist.

Patch Information

The maintainers released a fix in Astral uv0.8.22. The patched release validates symlink targets during sdist extraction and refuses entries that resolve outside the extraction prefix. Full details are available in the GitHub Security Advisory GHSA-7j9j-68r2-f35q.

Workarounds

  • Restrict uv to install only wheels until the upgrade is deployed across the fleet.
  • Install untrusted or unpinned packages inside ephemeral sandboxes or unprivileged containers to contain arbitrary file writes.
  • Route package installation through a vetted internal index that scans sdist contents for malicious symlink entries before republishing.

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.