Supply Chain Attacks in the Golang Open-Source Ecosystem

  • By David Abram
Supply Chain Attacks in the Golang Open-Source Ecosystem

Update: New Disk-Wiping Malware Found in Go Modules

Unfortunately, we’re seeing more and more supply chain attacks in the Go ecosystem, and the latest batch is especially nasty. Recently, security researchers uncovered a few Go modules that contain disk-wiping malware. Yep, you read that right: malicious code that can completely erase the main storage device on your Linux system, wiping out all data and leaving you with a dead server.

The modules prototransform, go-mcp, and tlsproxy are not just simple backdoors or spyware. They use clever obfuscation to hide a destructive shell script that runs a command like:

dd if=/dev/zero of=/dev/sda bs=1M conv=fsync

In plain English: this command zeroes out your entire primary disk.

That means all your files, your OS, your databases… gone. No backups, no recovery.

So how did this happen? Well, Go’s module system is very open. Anyone can publish a module on GitHub and have it pulled into your project without any central approval or cryptographic signing. This openness is great for flexibility but also a playground for attackers. They create modules with names that look legit or similar to popular libraries, tricking developers into using them.

The takeaway? Supply chain attacks aren’t just about sneaky backdoors anymore, now they can completely destroy your system.

What can you do right now?

  • Always check who’s publishing the module you want to use. If it looks suspicious or doesn’t have a solid community behind it, don’t use it.
  • Stick to trusted libraries that many people use and audit.
  • Develop inside virtual machines or containers. That way, if something bad happens, you can wipe and reset without risking your whole machine.
  • Use automated tools like govulncheck or Socket’s scanners to analyze dependencies.
  • Enforce checksum and signature verification when possible.

This new threat is a wake-up call. The open-source ecosystem is amazing, but you can’t trust everything blindly. Even a widely used module could hide something dangerous.

Stay alert, check your dependencies carefully, and keep your builds secure.


A Wake-Up Call for Go Developers

If you’ve been paying attention to software security news lately, you’ve probably heard about the Go Module Mirror serving a backdoored package for over three years.

Yeah, you read that right… three years. The attack leveraged a typo-squatted package and a fundamental flaw in how Go’s module proxy caches dependencies.

Thanks to Socket’s excellent article, we can dig a bit deeper into this attack.

The Anatomy of the Attack

Here’s what went down:

Attackers created a typo-squatted package named boltdb-go/bolt instead of the legitimate and widely used boltdb/bolt, deceiving thousands of developers. They then uploaded a malicious version of this package to GitHub, embedding a hidden remote access mechanism. The Go Module Mirror, designed for caching packages , inadvertently cached and stored the malicious version.

After ensuring the malicious package was cached, the attackers quietly rebased the repository back to a clean version, misleading manual reviewers into believing everything was safe. Developers continued unknowingly installing the compromised version because the Go Module Mirror never verified subsequent updates to cached packages, allowing the attack to be undetected for years.

This is a textbook case of a supply chain attack. It’s an attack that poisons the well that many developers drink from. The attacker injects malicious code at the package level and waits for unsuspecting developers to install it.

The Trust in Open Source

The core issue here is that our entire industry is built on the assumption that package managers and mirrors will “just work” safely.

But here’s the uncomfortable truth: we’re outsourcing trust to systems that weren’t built with security as a first-class concern.

Go’s module proxy is designed for performance and availability, not security. Once a package version is cached, it stays available, even if the original source is later modified or removed. That’s great for reliability but terrible when an attacker exploits it to persist malicious code for years.

This isn’t just a Go problem. We’ve seen similar attacks across npm, PyPI, and Cargo. The pattern is the same: developers rely on third-party dependencies, package managers optimize for performance over security, and attackers take advantage of it.

What you can do right now

It’s easy to say “just audit your dependencies,” but let’s be real, no one is manually checking every package they install. So, what practical steps can we take?

  • Go’s default module proxy has no built-in malware scanning. Consider using tools like Socket, deps.dev, or any other dependency analysis tools.

  • Instead of relying on latest package version, explicitly define which version you should be using. This won’t prevent all attacks, but it limits exposure.

  • Run automated dependency analysis like govulncheck, npm audit, or pip-audit. These tools won’t catch everything but provide an extra layer of defense.

  • Use checksums and signature verification where possible. If your build pipeline supports it, enforce checksum verification on dependencies.

The Bigger Picture

This incident is another wake-up call for the entire software industry.

We can’t blindly trust third-party code, even when it’s hosted on official mirrors.

Supply chain security is a real-world problem that has already led to major breaches and compromises.

Google has since removed the malicious package and added it to the Go vulnerability database, but the damage is already done. This attack reminds us that while Go, Rust, Python, and JavaScript all have safeguards to prevent classic memory safety issues, the real risk is in the dependencies we import without question.

Just because a package is widely used doesn’t mean it’s safe. It’s on us, developers, to be more proactive about security.

Stay safe out there, and check your dependencies before shipping.

Supply Chain Attacks in the Golang Open-Source Ecosystem
David Abram

Spends his time untangling software architectures and doing DevOps. Likes to build stuff.
Connect with David on X and LinkedIn. You can also Book a meeting with David.

Recommended posts

  1. What is cycle time in Software Development?

    What is cycle time in Software Development?

  2. Microservices Are a Way to Organize Your Company

    Microservices Are a Way to Organize Your Company

  3. Internal component libraries - an overlooked part of your brand

    Internal component libraries - an overlooked part of your brand