PyPI Tightens Package Security with New Upload Restrictions

www.news4hackers.com-pypi-tightens-package-security-with-new-upload-restrictions-pypi-tightens-package-security-with-new-upload-restrictions

PyPI introduces new upload restrictions to improve package security and reduce administrative overhead.

Introduction

PyPI has introduced a policy that blocks new file uploads to releases older than 14 days. This measure aims to safeguard Python users and minimize administrative efforts required to address compromised projects.

Quote from Seth Larson

The restriction ensures that security breaches do not create ambiguous states where some files in a release might be malicious while others remain unaffected, according to Seth Larson, Security Developer-in-Residence at the Python Software Foundation.

Current PyPI Policies

PyPI currently lacks defined protocols for handling releases that cease accepting new files and does not offer an API to verify a release’s status. Users are advised to avoid relying on these mechanisms.

PEP 694 and Community Support

The project intends to establish formal guidelines following the standardization of the Upload 2.0 API and Staged Previews under PEP 694, which outlines an extensible framework for uploading files to a Python package repository. The initiative gained community support after discussions around PEP 740 (Digital Attestations) in January 2024.

Incident and Analysis

The policy resurfaced following the March 2026 compromise of the LiteLLM and Telnyx packages, which resulted from a mutable reference in their use of the Trivy GitHub Action. PyPI’s analysis revealed the practice was uncommon, with only 56 of the top 15,000 packages uploading Python 3.14-compatible wheels more than 14 days after their original release.

Proposal by Mike Fiedler

The change was proposed by PyPI Safety Security Engineer Mike Fiedler and received backing during packaging discussions in 2026. The policy aligns with broader efforts to strengthen package repository security while balancing compatibility needs.

Conclusion

PyPI’s new upload restrictions reflect a proactive approach to securing Python packages, addressing vulnerabilities while maintaining compatibility for the majority of projects.



About Author

en_USEnglish