Threat actors are utilizing an attack called “Revival Hijack,” where they register new PyPi projects using the names of previously deleted packages to conduct supply chain attacks.
The technique “could be used to hijack 22K existing PyPI packages and subsequently lead to hundreds of thousands of malicious package downloads,” the researchers say.
If you ever install python software or libraries using pip install
then you need to be aware of this. Since PyPI is allowing re-use of project names when a project is deleted, any python project that isn’t being actively maintained could potentially have fallen victim to this issue, if it happened to depend on a package that was later deleted by its author.
This means installing legacy python code is no longer safe. You will need to check every single dependency manually to verify that it is safe.
Hopefully, actively maintained projects will notice if this happens to them, but it still isn’t guaranteed. This makes me feel very uneasy installing software from PyPI, and it’s not the first time this repository has been used for distributing malicious packages.
It feels completely insane to me that a software repository would allow re-use of names of deleted projects - there is so much that can go wrong with this, and very little reason to justify allowing it.
Another sign Python is hosed by abandoning “batteries included”.