PyPI Confirms No Malware Published Despite Massive GhostAction Token Theft Affecting 570+ Repositories

# Python Foundation Thwarts Major Supply Chain Attack, Invalidates Stolen PyPI Tokens

The Python Software Foundation has successfully neutralized a significant cybersecurity threat by invalidating all PyPI tokens stolen during the GhostAction supply chain attack in September, confirming that attackers failed to use these credentials to distribute malicious software.

## The Attack Uncovered

The incident came to light on September 5th when GitGuardian, a cybersecurity company, discovered malicious GitHub Actions workflows attempting to steal PyPI tokens and transmit them to remote servers. PyPI (Python Package Index) serves as the primary repository for Python packages, hosting hundreds of thousands of software components used by developers worldwide.

Unfortunately, a critical delay occurred when GitGuardian’s second security report landed in PyPI’s spam folder, postponing the response until September 10th. Once the full scope became clear, GitGuardian immediately opened security issues across over 570 affected repositories and alerted major platforms including GitHub, npm, and PyPI.

## Massive Scale of Compromise

The GhostAction campaign proved extensive, with GitGuardian estimating over 3,300 stolen secrets across multiple platforms. The compromised credentials included:

– PyPI and npm publishing tokens
– DockerHub and GitHub API tokens
– Cloudflare API credentials
– AWS access keys
– Database login information

The attack affected multiple programming ecosystems simultaneously, with some companies seeing their entire software development kit (SDK) portfolios compromised across Python, Rust, JavaScript, and Go repositories.

## Swift Response and Mitigation

PyPI administrator Mike Fiedler led the response effort, working closely with affected project maintainers. The team conducted a thorough investigation and found no evidence of compromised PyPI repositories or accounts. All potentially affected publishing tokens were invalidated as a precautionary measure.

Many project maintainers took immediate action by rotating their PyPI tokens, reverting malicious workflow changes, and removing compromised workflows entirely.

## Enhanced Security Recommendations

Following the incident, PyPI officials strongly recommend that package maintainers transition from long-lived tokens to short-lived Trusted Publishers tokens when using GitHub Actions. This approach significantly reduces vulnerability to similar attacks.

Package maintainers are also urged to regularly review their account security history for suspicious activity and implement robust security practices.

## Broader Context of Supply Chain Threats

This incident represents the latest in a series of supply chain attacks targeting software repositories. In August, the s1ngularity attack exploited GitHub Actions workflows, affecting over 2,180 accounts and 7,200 repositories. Additionally, the Python Software Foundation recently warned users about phishing campaigns using fake PyPI websites to steal credentials.

## Key Takeaways

While the GhostAction attack successfully exfiltrated numerous credentials, the rapid response from security researchers and platform administrators prevented any malicious packages from being published. This incident highlights both the growing sophistication of supply chain attacks and the importance of robust security monitoring and response protocols in protecting the software ecosystem that millions of developers rely on daily.

The successful mitigation demonstrates the value of collaboration between security researchers, platform administrators, and the developer community in defending against evolving cyber threats.

Share This Article