A Central Point of Attack in Modern Software Development
A Thought Experiment on Security, Convenience, and the Future of Code Distribution
Introduction: The Double-Edged Sword
Package managers changed how we build software. Python's PyPI, JavaScript's npm, Rust's Cargo, Go's module proxy—these systems made it stupidly easy to share code, reuse libraries, and get things done. What used to take weeks of coding can now be done in minutes with a pip install or cargo add.
But there's a dark side to this convenience. Every package manager is a central point of attack—a single place where bad actors can inject code that ends up running on millions of machines worldwide. The 2024-2026 period made this painfully obvious. Supply chain attacks got more sophisticated, more frequent, and more damaging than ever.
This isn't a new problem, but it's reaching critical mass. Let's look at what's been happening, why package managers are inherently risky, and whether there's a better way.
The Attack Landscape: 2024-2026
The past two years have been a wake-up call for the software industry. Supply chain attacks hit every major ecosystem—Python, JavaScript, Ruby, Rust, Go.
PyPI Under Siege
The Python Package Index became a frequent target. In 2025, researchers uncovered ongoing campaigns pushing malicious packages across multiple ecosystems.
The TeamPCP Campaign: This campaign compromised LiteLLM packages on PyPI. Attackers used typosquatting and brand impersonation to trick developers into downloading malicious versions.
Discord Webhook Attacks: Several malicious PyPI packages sent developer credentials and environment variables to attacker-controlled Discord webhooks. These packages masqueraded as popular utilities and exploited legitimate dependencies to hide their behavior.
Cryptocurrency Drainers: Multiple packages designed to drain crypto wallets, targeting developers working with Web3 technologies.
npm: The World's Largest Registry Under Attack
With over two million packages, npm is an enormous attack surface. In September 2025, CISA issued a rare alert about a widespread supply chain compromise in the npm ecosystem.
The Axios Compromise (2026): Perhaps most alarming—the Axios npm packages were backdoored, attributed to BlueNoroff/Lazarus Group (known state-sponsored actors). This attack specifically targeted cryptocurrency companies, showing how package registry attacks get weaponized for geopolitical and financial gain.
North Korean Actors: A Korean threat actor published 338 malicious npm packages with over 50,000 downloads, designed to steal credentials from developers.
RubyGems: Credential Theft at Scale
Ruby developers haven't been spared. Security researchers found 60 malicious Ruby gems containing credential-stealing code, downloaded over 275,000 times since March 2023. Targets included developer infrastructure and financial systems.
Rust Crates.io: A False Sense of Security?
The Rust community prides itself on security and correctness. Yet crates.io has faced attacks:
faster_log and async_println: These malicious crates typosquat popular packages, attempting to steal developer credentials and exfiltrate data.
evm-units Malware: A malicious Rust crate delivered OS-specific malware targeting Web3 developers. Over 7,000 downloads before detection.
CrateDepression: This attack targeted GitLab CI pipelines, using typosquatting to infect cloud build systems with Go malware.
The Rust team eventually stopped publishing blog posts for every malicious crate detected—the attacks became too frequent to announce individually.
Go Modules: Three Years of Backdoors
Perhaps the most disturbing case came from Go. In February 2025, researchers discovered that Google's own Go module mirror served a backdoored package for over three years. The package exploited module proxy caching behavior to persist undetected, affecting countless developers who trusted Google's infrastructure.
This incident highlights a fundamental truth: the trust model of package managers is fragile. When a single compromised package propagates through mirrors and caches worldwide, the attack surface extends far beyond the original registry.
Why Package Managers Are Inherently Risky
Single Points of Failure
Every package manager creates a single point of failure. When npm, PyPI, or any major registry gets compromised, every developer using that system becomes potentially vulnerable. It's not just about direct downloads—it's about cascading effects through CI/CD pipelines, container images, and production systems.
The Trust Problem
Modern package managers rely on an honor system. Package publishers are trusted to maintain security, but there's often:
- No mandatory security review process
- Weak or non-existent two-factor authentication requirements
- Limited verification of package ownership
- Typosquatting and brand confusion that's easy to exploit
The Dependency Graph Problem
Modern applications can have thousands of transitive dependencies. One vulnerable package can compromise an entire dependency tree. You might trust your direct dependencies—but do you trust their dependencies? Their dependencies' dependencies?
Update Mechanisms as Attack Vectors
Package managers automatically fetch updates. This convenient feature becomes an attack vector. A malicious actor who gains publish access can push malicious updates to all users instantly.
Is No Package Manager Better?
Given these risks, a legitimate question emerges: should we abandon package managers entirely?
The Distributed Repository Model
Some argue for distributed approaches:
- Vendoring: Including dependencies directly in your repository
- Mirror pinning: Locking to specific versions from specific sources
- Air-gapped development: Isolating development environments from the internet
These approaches have merit. Vendoring your dependencies means you control exactly what code runs. You can audit every line, eliminate transitive dependencies you don't need, and ensure reproducibility without relying on external infrastructure.
The Problems with Going Solo
But distributed approaches have significant drawbacks:
- Discoverability: Finding the code you need becomes dramatically harder
- Maintenance burden: Security patches become your responsibility
- Storage and bandwidth: Duplicating libraries across projects wastes resources
- Version management: Keeping track of which project uses which version becomes complex
The reality is that package managers exist because they're genuinely useful. The productivity gains are enormous. The question isn't whether to use package managers, but how to use them more safely.
Rolling Your Own: An AI-Powered Future?
With AI coding agents becoming increasingly capable, some propose a different approach: rolling your own solutions instead of relying on packages.
The AI Agent Argument
Modern AI coding agents can:
- Write production-quality code in seconds
- Understand complex codebases and generate appropriate solutions
- Learn from context and produce code that fits your specific needs
- Reduce reliance on third-party libraries for common tasks
If AI agents can write code that's as good as (or better than) what you'd get from a package, why not use them?
The Problems with This Approach
It's not that simple:
- Correctness: AI-generated code can contain bugs, security vulnerabilities, and subtle errors
- Auditability: Generated code may not be thoroughly tested or reviewed
- Consistency: Different AI outputs at different times may create inconsistent codebases
- Liability: When something goes wrong with AI-generated code, who's responsible?
There's also a deeper issue: AI agents are often trained on the very packages we're worried about. They may recommend and use packages without fully understanding the security implications.
Conclusion: A Thought Experiment Without an Answer
After exploring this landscape, I'm left with a profound question: is there a better way?
Package managers represent a fundamental trade-off. They give us tremendous productivity at the cost of centralization and trust. Every compromise—vendoring, rolling your own, using AI—has significant drawbacks.
Perhaps the answer lies somewhere in the middle:
- Better tooling: Package registries with mandatory security audits, provenance tracking, and strong authentication
- AI-assisted verification: Using AI to audit packages before installing them
- Defense in depth: Combining package managers with vendoring, scanning, and monitoring
- Community vigilance: Paying attention to package publishers and reporting suspicious activity
The uncomfortable truth is that nothing is perfect. Centralized package managers are attack vectors, but distributed approaches have their own problems. AI agents are powerful but bring new risks. We live in an interconnected world, and software security requires constant vigilance.
Maybe AI will fix this problem—or maybe it will make it worse. That's a thought experiment I'll leave with you.
What I do know: we can't afford to be complacent. Every pip install and npm install should come with awareness of the trust we're extending. Package managers transformed how we build software. Now we need to transform how we secure them.
Cheers, Lee
References and Further Reading
- The Hacker News - Malicious PyPI, npm, and Ruby Packages
- CISA Alert - Widespread Supply Chain Compromise Impacting npm
- Ars Technica - Go Module Mirror served backdoor for 3+ years
- The Hacker News - Malicious Rust Crate Delivers OS-Specific Malware
- Socket Security - Go Supply Chain Attack: Malicious Package Exploits Go Module Proxy
- Bleeping Computer - 60 malicious Ruby gems downloaded 275,000 times
- Rust Blog - Malicious crates faster_log and async_println