Description

The Python Package Index (PyPI) has added new upload limits to prevent malicious ZIP archives that might be employed in "parser confusion" attacks. The modifications are designed to safeguard Python package installers as well as inspection tools from security risks caused by uncertainties in the interpretation of ZIP files. Although no attacks exploiting this problem have been known to target it via PyPI, developers found various Python tools to read the same ZIP file in different ways, enabling attackers to hide malicious files unnoticed. ZIP-based wheel distributions, common in Python packaging, are especially exposed to these differences. Malicious actors can take advantage of inconsistencies in how ZIP archives are interpreted — particularly where installers fail to rigorously check the RECORD file that is supposed to enumerate and hash all the files included. PyPI is currently blocking uploads containing malformed ZIP structures like duplicate file names, mixed-up headers, and invalid directory markers. Beginning February 1, 2026, wheels with incompatible RECORD metadata will also be blocked. Happily, most popular PyPI packages are exempt. In order to remain safe, developers and users must make sure they have their packaging and installation tools up to date. If an upload is rejected, developers need to go through error logs and fix their build process. Package tool maintainers are advised to conform to Python's zipfile module behavior and cross-check package content with its RECORD file to avoid exploitation.