Revival Hijack – PyPI hijack technique exploited in the wild, puts 22K packages at risk
When a project is deleted from PyPI, its package name becomes immediately available for anyone to register, so an attacker can re-register a removed name and publish a malicious version. Anyone who upgrades or reinstalls the package, including automated CI/CD jobs, would then pull the attacker's code; the researchers saw this used in the wild against the pingdomv3 package.
Published on jfrog.com
JFrog’s security research team continuously monitors open-source software registries, proactively identifying and addressing potential malware and vulnerability threats to foster a secure and reliable ecosystem for open-source software development and deployment. This blog details a PyPI supply chain attack technique…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the registry frees a deleted project's name for immediate re-registration without blocking reuse, and package managers treat a same-name package from a different owner as a routine upgrade.
Impact
An attacker could take over abandoned but still-downloaded package names and deliver malicious code to anyone upgrading or reinstalling them, including automated CI/CD pipelines; the researchers' own empty placeholder packages drew almost 200K downloads in three months, though they could not confirm code execution in every case.
What the attacker needed
A package name is deleted on PyPI; attacker registers the freed name; victim upgrades or reinstalls the package
The fix
PyPI should permanently block reuse of a deleted project's name, for example by automatically adding removed names to its blacklist, and users should check that CI jobs do not install removed packages.
How it was found
- Create and publish an empty test package from one account.
- Delete the project so the name becomes free.
- Publish a package with the same name from a different account and a higher version.
- Run pip to list outdated packages and see the imposter shown as a new version.
- Run pip install --upgrade and observe the original package replaced without warnings.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
PyPI is the public library where Python developers download reusable code packages. Normally a package name belongs to one owner, but if that owner deletes their project the name is freed up straight away, and someone else can claim it and upload their own code under the same name. Tools that update packages then treat the new code as a normal update, so malicious code can arrive without the user doing anything wrong.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.