Practical technical guides / Recent development: uv 0.13.10 (2026-11-24)

uv 0.13.10 Rejects ZIP Members Whose Two Compressed Sizes Disagree

uv 0.13.10 (24 November 2026) fixes GHSA-vjvj-3m3f-fgmm: ZIP members whose descriptor and central sizes differ. Why hash pinning does not help, and what to do.

By Sandeep Belgavi · Published 2026-11-26

One ZIP member, two compressed sizes
Original explanatory diagram; synthetic values where shown.

uv 0.13.10 (24 November 2026) fixes GHSA-vjvj-3m3f-fgmm: ZIP members whose descriptor and central sizes differ. Why hash pinning does not help, and what to do.

Two installers, one archive, different files

uv 0.13.10, released on 24 November 2026, addresses security advisory GHSA-vjvj-3m3f-fgmm, published the same day and rated low severity. The advisory describes ZIP payload obfuscation through conflicting compressed sizes: in uv versions 0.1.29 through 0.13.9, an attacker can construct a ZIP archive that uv and pip both install successfully but that produces different file contents depending on the installer. The fix, pull request 23332, merged on 20 November, makes uv reject ZIP members whose validated data descriptor size disagrees with the compressed size in the central directory.

The vulnerability is narrow, and the advisory is careful about its limits. The lesson is broader. Any time two programs parse the same bytes with different rules, a reviewer, a scanner and an installer can each see a different package, and a checksum that all of them verify does not help. This guide explains why a ZIP member can carry two sizes, reproduces the divergence defensively with Python's standard library, and lists what to upgrade and check.

Why a ZIP member can carry two compressed sizes

A ZIP archive describes each member twice. A local file header sits in front of the member's data, and a central directory at the end of the file lists every member again with its sizes, checksum and the offset of its local header. Normal readers start from the central directory, because it is the authoritative index.

Writers that cannot seek back to fill in the local header, such as programs streaming an archive to a network socket, set bit 3 of the general-purpose flags. The local header then carries zeros for the CRC and sizes, and a data descriptor after the member's data records the real values. The central directory, written at the end when the writer knows everything, records them as well. So a member written this way has a compressed size in its data descriptor and another in the central directory, and nothing in the format forces a reader to check that they agree.

The advisory explains how the two installers diverged. uv's streaming extractor reads to the end of the compressed data and validates against the descriptor. Python's zipfile module, which pip relies on, reads only the number of compressed bytes the central directory declares. Understate that number and zipfile reads a prefix of what uv extracts.

Reproduce the divergence defensively

The companion example writes a small synthetic module with zipfile to an unseekable stream, which makes zipfile use a data descriptor, and then changes one field: the central directory's compressed size, from 86 bytes to 29. It changes nothing else.

flags bit 3 (data descriptor): True central csize: 86 usize: 258
patched central csize: 29
zipfile: BadZipFile - Bad CRC-32 for file 'pkg/__init__.py'
streaming reader after patch: consumed 86 bytes out 258 descriptor csize 86
check_members(patched): [{'name': 'pkg/__init__.py', 'consumed': 86, 'descriptor': 86, 'central': 29}]

zipfile inflated only 29 compressed bytes, got a prefix of the module, and rejected it because the checksum covers the whole file. A minimal streaming reader that inflates until the deflate stream ends and then reads the descriptor extracted all 258 bytes. That is the advisory's first case: one tool refuses the archive while another installs it.

The advisory's second case is the dangerous one. If the prefix and the full file share a CRC-32, zipfile accepts the prefix, so pip installs one file and uv another, and the advisory notes the prefix can be empty while uv's copy contains executable code. CRC-32 is not a cryptographic checksum, so arranging that is possible. The example does not construct it; the first case is enough to show the mechanism, and the defence is the same.

Why hash pinning does not close this

Lock files and pinned hashes are the standard supply-chain control for Python packages, and they remain essential. They prove that you received the bytes you expected. The advisory points out that both installers can verify the same SHA-256 digest, because they receive identical archive bytes. A reader differential happens after verification, inside the parser. A hash pins the archive, not the interpretation.

The same reasoning applies to anything that inspects a package before installing it. A malware scanner, a license checker or a code reviewer that opens wheels with zipfile sees the central-directory view. If the installer extracts something else, the review was of a different package. Consistency between the tools you use matters as much as the correctness of each one.

What uv 0.13.10 changes, and what it does not

The pull request description is precise. When streaming a wheel, uv already checked how many compressed bytes it read against the member's data descriptor, but skipped the comparison against the central directory. The fix compares the validated descriptor size with the central-directory size, so both reproductions in the pull request fail the check regardless of their CRC-32. Its regression test changes only the central-directory size in an otherwise valid archive.

Exploitation still requires installing or building an attacker-controlled distribution. For a wheel, the concealed code runs when the installed module is later imported. For a ZIP-based source distribution, which is less common than a tarball, it can run during resolution or installation if uv invokes the package's build backend. The advisory rates the issue low partly because PyPI itself now applies ecosystem-wide mitigations for malformed ZIPs. Packages from private indexes, direct URLs and local files do not pass through PyPI's checks.

The same release adds lock file validation that is worth knowing about when you upgrade: uv now validates that dependency requirements in uv.lock match the locked package versions, explains why the lock file needs updating when --locked rejects it, and reports dependencies whose package entries are missing.

What to do

Upgrade uv to 0.13.10 or later everywhere it installs packages: developer machines, CI images and container build stages. Check pinned versions in Dockerfiles and CI setup actions, because those are where old installers persist longest.

If you mirror or proxy packages, consider rejecting malformed archives at the mirror, so every client benefits regardless of version. The companion check_members function shows the condition to test: for each deflated member that uses a data descriptor, the bytes actually consumed, the descriptor size and the central-directory size must be equal.

# Author: Sandeep Belgavi. The agreement check, for deflated members with a data descriptor.
def check_members(data: bytes):
    problems = []
    for e in central_entries(data):
        if not e["flags"] & 8:
            continue
        _, consumed, _, dcsize, _ = streaming_read(data, e["lho"])
        if not (consumed == dcsize == e["csize"]):
            problems.append({"name": e["name"], "consumed": consumed, "descriptor": dcsize, "central": e["csize"]})
    return problems

Treat this as a teaching check, not a parser. It handles only deflated members and assumes well-formed headers. For production use, rely on the fixed installer and on mirror-side validation by a maintained tool.

Finally, align your inspection tools with your installer. If a scanner runs on wheels before installation, make sure it rejects archives the installer would reject, or run the scan on the installed files rather than on the archive.

The general pattern

Parser differentials are an old class of bug. HTTP request smuggling is one: a proxy and a server frame the same bytes differently, which this site covers at /blogs/security/http_request_smuggling_framing.html. Path traversal in archives is another, at /blogs/security/path_traversal_zip_slip.html. The defence is the same each time: when a format allows two descriptions of the same thing, require them to agree and reject the input when they do not, instead of picking one silently.

Verification checklist

Run uv --version in every image and pipeline that installs packages and confirm 0.13.10 or later. Run the companion tests to see the divergence and the check on your Python version. If you operate a package mirror, add a malformed-archive test case like the one in the example and assert that the mirror rejects it. Revisit the advisory page for later updates, since advisories are sometimes revised after publication.

Interactive experiment

ZIP readers: descriptor size versus central directory size. Synthetic browser-local fixtures, adjustable inputs, decision traces and JSON export.

Primary references and authorship

Sources checked 2026-11-26. Original explanation and synthetic examples by Sandeep Belgavi. Companion code: Sandeep-BA/agent-decision-lab/examples/python/zip_size_agreement. Views are my own and do not represent any employer, past or present.