Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Identity & Access

PyPI Enforcing 2FA for All Project Maintainers to Boost Security

PyPI will require all accounts that maintain a project to enable two-factor authentication (2FA) by the end of 2023.

The Python Package Index (PyPI) has announced that it will require all accounts that maintain a project to have two-factor authentication (2FA) enabled by the end of 2023.

The official software repository for Python, PyPI has become the target of numerous supply chain attacks over the past years, in some of which threat actors compromised maintainer accounts to inject malicious code into projects.

By enforcing 2FA for project maintainers, PyPI wants to prevent account takeover attacks, thus reassuring the community that only people associated with a project can upload, modify, or delete code.

“Between now and the end of the year, PyPI will begin gating access to certain site functionality based on 2FA usage. In addition, we may begin selecting certain users or projects for early enforcement,” PyPI administrator and maintainer Donald Stufft says.

PyPI project maintainers can use either a security device or an authenticator application for the second authentication step, and can also switch to using trusted publishing (relies on the OpenID Connect (OIDC) standard for token exchange) or API tokens when uploading to PyPI.

By requiring 2FA to be enabled for all maintainer accounts, including organization accounts, PyPI wants to make sure that all projects on the repository are better protected.

Advertisement. Scroll to continue reading.

“[It] only takes one compromised project in someone’s dependency set to compromise their computer. […] Once compromised, an attacker can extend that attack to attack other systems, including other projects on PyPI that the now compromised person maintains,” Stufft notes.

In addition to enforcing 2FA, PyPI is working on reducing the amount of IP address data it stores, by evaluating where that type of data is needed on the site and removing its collection where it is not.

Thus, while IP addresses are still used for rate limiting and fallbacks, they are no longer stored in Journal entries, which are accessible to admins only. IP data is still needed to prevent abuse, but the repository is searching for alternative approaches that could also help increase user security.

Following a recent audit, PyPI discovered that the use of PGP signatures when uploading packages to the repository is no longer defensible, given low usage and other issues, and has decided to remove PGP. While existing signatures will continue to work, no new ones will be made available and any newly uploaded PGP signatures will be ignored.

Related: Malicious NPM, PyPI Packages Stealing User Information

Related: PyPI Users Targeted With ‘Wacatac’ Trojan in New Supply Chain Attack

Related: PyPI Users Targeted With PoweRAT Malware

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing for the latest cybersecurity threats, trends, and expert insights.

Click to comment

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Close the security gaps between pentests. Join this session to explore agentic pentesting and gain a practical framework for continuous exposure validation in your CTEM program.

Register

Join as we bring together CISOs, senior cybersecurity executives, practitioners, industry experts, and other security leaders to share practical experience and examine the issues shaping enterprise cybersecurity strategy.

Register

People on the Move

Rob T. Lee has joined Dragos as Chief AI Officer.

Barracuda has appointed Dan Fletcher as CFO.

Artemis Security has appointed Arun Singh as CGO.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.