Go straight to an AI summary of this blog post instead

  • Summarize this post with Perplexity
  • Summarize this post with Gemini

Key Takeaways

  • A Go module proxy is built to serve files, not to judge whether those files are safe to run.
  • One character in your GOPROXY string decides whether a dead proxy fails loudly or quietly sends builds to the public internet.
  • GOPRIVATE skips the public checksum database for every path it matches, so one broad pattern can switch that protection off far more widely than intended.

In May 2026, researchers flagged a wave of malicious Go modules published under a GitHub account called BufferZoneCorp. Credential theft was part of the payload, but the interesting part was what several of the Go modules went after: the build machinery itself. They poisoned GOPROXY, weakened checksum verification, edited go.sum, and dropped fake go wrappers into workflow paths so later CI steps ran the attacker’s binary instead of the real toolchain. The Go security team blocked the identified modules. The technique still works anywhere module plumbing gets treated as configuration rather than as a security boundary.

Caching gives that plumbing a long memory. A module can stay reachable well after its source has changed or disappeared, and an earlier Go backdoor showed how far that goes – the public Go module proxy kept serving a malicious version for more than three years after the corresponding GitHub tag had been quietly rewritten (more on that below). That persistence problem is a big part of why teams stand up an internal module proxy and point GOPROXY at it.

The instinct isn’t wrong. Build reproducibility improves, cached dependencies stop depending on the public proxy being reachable, and there’s finally one place to see what the organization depends on.

What doesn’t follow is the security conclusion. A module proxy serves bytes. The protocol itself has no content verification step and no policy mechanism, and it makes no judgment about what sits inside the files it hands back. Running your own proxy means controlling the cache – useful, but not the same thing as controlling what gets into it.

What a Go Module Proxy Actually Does

The module proxy protocol is small on purpose. A proxy is an HTTP server exposing a handful of endpoints per module path:

Endpoint Returns
$module/@v/list Known versions, one per line
module/@v/version.info JSON metadata including the version timestamp
module/@v/version.mod The go.mod file for that version
module/@v/version.zip The module source archive
$module/@latest The version the proxy considers newest

 

That’s the whole surface. Nothing on that list carries a signature, a scan result, a policy verdict, or any verifiable claim about where the code came from.

Note: Because the protocol is plain HTTP GETs over a predictable path layout, a directory of files served by NGINX technically qualifies as a valid Go module proxy. That’s part of why proxies spread through the Go world so fast, and part of why so few of them verify anything unless you build that in yourself.

Verification in Go happens on the client side, not at the proxy. The go command checks downloaded module content against the hash in go.sum. When that hash isn’t already recorded, it normally fetches one from the checksum database, an independent append-only log, before writing it to go.sum. Once recorded, later builds just compare against that stored hash.

So the security properties most teams give their proxy credit for are really properties of go.sum and GOSUMDB. Those work exactly the same whether you’re running a proxy or hitting proxy.golang.org directly.

The Comma and the Pipe Decide Your Fallback Behavior

GOPROXY takes a list of sources, and the character separating them changes what happens when one of those sources fails.

# Falls through to the next entry only on 404 or 410

GOPROXY=https://goproxy.internal.example.com,direct

 

# Falls through to the next entry on ANY error

GOPROXY=https://goproxy.internal.example.com|direct

GOPROXY comma vs pipe separator: comma fails the build safely, pipe silently falls back to the public internet

That diagram assumes direct is the next source in the list, the way the examples above have it. On its own, a pipe only means fall through to whatever comes next.

A comma tells the go command to try the next source only when the current one flatly reports the module as absent, a 404 or a 410. A pipe tells it to try the next source on any error at all, timeouts included, TLS failures included, 500s included.

Picture what that means mid-incident. Your internal proxy has a bad deploy and starts throwing 502s. With a pipe followed by direct, every build across the organization quietly starts resolving modules from public version control instead.

Separator Falls through on Behavior when the proxy is down
Comma 404 and 410 only Other proxy errors stop resolution, so builds fail loudly
Pipe Any error Resolution moves to the next source, so a trailing direct quietly bypasses the proxy

 

Pro Tip: Look at what your CI actually has set, not what the runbook claims it has set. GOFLAGS and GOPROXY tend to get inherited from base images, and a pipe someone added two years ago to unblock a flaky deploy is exactly the kind of thing that survives every review after that, because the builds keep going green.

The trailing direct in most GOPROXY strings deserves its own look too. It tells the toolchain to fall back to version control when the proxy comes up empty, so a module path your proxy has never seen still resolves straight from its upstream repository like normal. If the whole point of standing up a proxy was to be the only source of truth, direct quietly undoes that.

GOPROXY=off is the strictest option going. The go command won’t download modules at all, so anything a build needs has to be sitting in the module cache already. Dropping the trailing direct gets you a hard source boundary without going quite that far.

Why Self-Hosting Verifies Nothing on Its Own

Cache-and-serve proxy with no verification step vs rebuild-and-verify that checks packages before the build

Athens is solid software. It does exactly what a module proxy is specified to do.

What it does not ship with is any opinion about what sits inside a module. There’s no built-in malware scan, no check that the archive matches its source repo, and no out-of-the-box way to say “block this module, it started doing something new in v1.4.2.” Standard filtering works on module paths rather than on anything the code is doing. Athens does expose a validation hook that gets called on every module download, so operators can extend it with their own scanning or policy logic, but that verification is something you design, run, and keep running.

That gap matters because of where malicious Go code runs. Go doesn’t have an install-time script hook the way npm does, which is a real point in its favor. But malicious code in a Go module still runs later, when an application or tool that imports the package is executed, typically through an init() function that fires during program startup.

A proxy that caches and serves that module hasn’t done anything wrong by the spec. It has done exactly the job it was built for.

The real gap is whether the archive a proxy hands out matches the source repository its module path claims to point at. Nothing in the protocol requires a module zip to correspond to any particular commit, which makes it an artifact rather than an attestation. Rebuilding a module from source and comparing that result against what the path served is a different control, and it has to happen before the artifact is admitted to a trusted store or served to a build.

Five GOPROXY Architectures Compared

Five setups cover almost everything teams run in practice. What separates them is what each one screens and who’s on the hook for operating it.

Architecture Availability control Screens module content Operational load
Direct from VCS None, depends on the upstream host No None
Public proxy with direct fallback Google’s cache plus VCS No None
Self-hosted proxy such as Athens You control the cache Not by default Moderate, you run it
Repository manager proxy You control the cache, plus policy rules Varies by product and add-ons Moderate
Screened and rebuilt registry You control the cache Yes Low, operated for you

 

The public proxy with direct fallback is the default most teams start on, and it’s better than its reputation. proxy.golang.org maintains an immutable cache, so a version it has served once stays available and unchanged even if the upstream repository is deleted. That’s a real security property, and self-hosting doesn’t reproduce it automatically.

A self-hosted proxy like Athens is where a lot of teams end up, and the honest summary is that it buys availability and visibility rather than verification.

A repository manager proxy adds centralized access control, and depending on the product and the policy add-ons you license, it can audit components against policy and quarantine the ones that fail. What ordinary proxying still doesn’t establish is that an artifact was rebuilt from, and corresponds to, the source its path claims.

A screened and rebuilt registry is a different category rather than a variation on the first four. It rebuilds each module from source and screens it for malware before serving it, which is why it’s the one row that answers the screening column with a yes. That’s the model SecureChain for Go is built on, with Go coverage scheduled for Q4 2026.

Where Proxy Cache Abuse Comes From

Cache-related incidents against Go module infrastructure tend to follow the same shape, and one from early 2025 shows it well. In February that year, researchers found a module called github.com/boltdb-go/bolt impersonating BoltDB, a widely used embedded key/value store that had more than 8,000 dependent packages when the incident was reported.

The threat actor had published the malicious version back in November 2021, then rewrote the GitHub tag so it pointed to a clean commit, which meant anyone auditing the repository by hand saw nothing wrong. The Go module proxy had already cached the original malicious version, and because that cache is designed to be immutable, the backdoored copy stayed available for more than three years to any client resolving that module version, until researchers eventually flagged it as a typosquat.

Timeline of a Go module typosquat cached by the proxy and found 3+ years later

This wasn’t a checksum failure. boltdb-go/bolt was a distinct, impersonating module path, so there was no trusted checksum for the real BoltDB that the fake one had to match. Go’s integrity checks were happy to authenticate the typosquat’s own bytes, because that is the question they answer. The backdoor succeeded on naming.

That distinction matters, because it isn’t the same as pure trust on first use. For public modules, the client normally checks the checksum database, an independently authenticated log, the first time it needs a hash for a version, so a proxy can’t unilaterally change the trusted value for a version that’s already recorded. A self-hosted proxy still decides which artifact the client sees first, but with GOSUMDB on it’s the checksum database, not the proxy, that decides whether that artifact gets accepted.

What none of that does is vet whether a module deserves trust in the first place, which is exactly the gap a typosquat walks through. And the public half of it steps aside for anything matched by GOPRIVATE, or in any environment running with GOSUMDB set to off.

Scenario Go’s integrity checks catch it
Cached version is later modified in place Yes, go.sum mismatch
First resolution of a public module through a compromised proxy Usually yes, if GOSUMDB is enabled and has, or can fetch, a record for that version
Module path matched by a GOPRIVATE pattern Partly, the public database lookup is skipped by default, though an existing go.sum entry still catches later tampering
Proxy serves a public version the upstream never published Yes, where checksum database verification applies, since the database can’t authenticate a version that doesn’t exist upstream

 

What GOPRIVATE Quietly Turns Off

GOPRIVATE exists for a good reason. Private modules shouldn’t get requested from a public proxy, and their paths shouldn’t get sent to a public checksum database either, since the module path itself can leak information about what you’re building.

It’s also a convenience variable, and the side effect is where things go sideways. GOPRIVATE supplies the default value for both GONOPROXY and GONOSUMDB, per Go’s module reference, which means every path it matches is excluded from the proxy and from the public checksum database at the same time, unless one of those two variables is set separately.

Here’s where that goes wrong in practice.

GOPRIVATE=github.com/yourcompany/*

Narrow enough, and it matches the organization you meant to match.

GOPRIVATE=*.example.com,github.com/*

That second pattern excludes every module hosted on GitHub from the public checksum database, which covers an enormous share of what most Go builds pull. It’s easy for patterns to widen this way: a resolution failure needs fixing, and loosening the match is the change that makes the build go green immediately.

Audit what your environments actually have set:

go env GOPROXY GOSUMDB GOPRIVATE GONOPROXY GONOSUMDB GOFLAGS

Run that on a CI runner, not just your laptop. The two can differ, because CI picks up variables from base images and runner configuration.

Set them deliberately. Configure GONOPROXY and GONOSUMDB directly when your routing and your checksum policy need to differ, which happens more often than teams expect. If a trusted internal proxy serves both public and private modules, GONOPROXY=none keeps everything flowing through that proxy while GONOSUMDB covers only the genuinely private paths. What you don’t want is the reverse, leaving private paths in the public database lookup, which either breaks the build or leaks the path to a public service.

Choosing an Architecture

The decision comes down to what problem you’re actually trying to solve, and being honest about that shortens the whole project considerably.

If the driver is availability and build reproducibility, run a self-hosted proxy or a repository manager, use a comma rather than a pipe, and stop calling it a security control. It’s good infrastructure doing exactly the job it was built for. If the driver is visibility into what the organization depends on, almost any proxy gets you there, and repository manager options give better reporting for less operational overhead.

If the driver is policy enforcement over which modules are allowed, a repository manager with path rules is the floor, and its policy or firewall add-ons are where enforcement actually lives. Athens can be pushed in that direction through its validation hook, but you own the logic, the tuning, and the pager.

If the driver is verifying that module content deserves trust, the proxy protocol on its own doesn’t answer that, because it was never built with a verification step. That control has to sit around the proxy, or come from a system that validates artifacts against source before serving them.

And if Go sits alongside npm, PyPI, Maven, or crates.io in your stack, decide the architecture once, across all of them. Five per-ecosystem proxies run by five different teams are exactly how coverage gaps show up. PolinRider is a good example of why that’s true: the North Korea-linked campaign tracked under that name has been publishing malicious packages across npm, Packagist, Go modules, and Chrome extensions, and it was still active when researchers wrote it up in July 2026. The wider Contagious Interview cluster it belongs to has been tied to more than 1,700 malicious packages across npm, PyPI, Go, and Rust. A stack-level problem needs a stack-level answer, not five disconnected caches.

A proxy is the right place to solve availability, latency, and reproducibility. It’s a poor place to solve trust. Keeping those two goals separate keeps the architecture simple and gets a working proxy shipped. Mixing them turns a straightforward caching project into a much larger policy and security engineering effort, with a real risk of ending up with a complex policy layer bolted onto what is fundamentally a caching component.

Where TuxCare SecureChain Fits

There’s also a problem no proxy touches: modules nobody is maintaining anymore. A cache serves a dormant module exactly as faithfully as an actively maintained one, and an unpatched module with a known CVE and no upstream fix isn’t something a cache architecture solves. Backporting a fix to code the maintainer walked away from is its own discipline, built around regression testing and behavioral compatibility, which is usually why it ends up outside a platform team’s remit.

If the piece your architecture is missing is verification, that’s the gap SecureChain is built to close across the ecosystems that usually sit in the same stack. npm is live today, Maven and PyPI arrive in August 2026, and Go, Rust/crates.io, and Packagist/PHP follow in Q4 2026. In each one, SecureChain rebuilds packages from source, screens them at fetch time before anything reaches a build, and keeps patching known vulnerabilities even after a package’s upstream has gone quiet. Wondering how that fits your own GOPROXY setup, or the rest of your stack? Ask us a question and the team will walk you through it.

FAQ

What is a Go module proxy?

An HTTP server implementing the Go module proxy protocol. It serves version lists, metadata, go.mod files, and source archives for module paths. It caches and it routes, and the protocol itself includes no verification of the content it hands back.

Does running my own Go module proxy make builds more secure?

It improves availability, reproducibility, and visibility, all useful things. The proxy protocol has no verification step of its own. Content authentication happens client-side: the go command checks downloads against go.sum, and for public modules against the checksum database when no hash is recorded yet. That works the same whether you’re running a proxy or not, unless GOSUMDB is off or the path is excluded from the public database through GOPRIVATE or GONOSUMDB.

What is the difference between a comma and a pipe in GOPROXY?

A comma makes the go command fall through to the next source only on a 404 or 410, so any other proxy error stops resolution. A pipe makes it fall through on any error at all, which means a proxy outage can quietly send builds out to the public internet instead of just failing.

Does GOPRIVATE disable checksum verification?

By default it skips the public checksum database lookup for matched paths, because GOPRIVATE feeds GONOSUMDB. An existing go.sum entry can still catch a later content change.

Is Athens enough for a private Go module proxy?

For availability, caching, and internal module distribution, yes. Its standard filtering works on module paths rather than content, so out of the box it won’t tell you whether a module is malicious or whether the archive it’s serving matches its source repository. Its validation hook can be extended with that kind of logic, but you design and operate that part yourself.

How do I check what my Go builds actually trust?

Run go env GOPROXY GOSUMDB GOPRIVATE GONOPROXY GONOSUMDB GOFLAGS on a CI runner. Configuration inherited from base images and runner settings frequently differs from local dev setups, and from whatever the runbook says it should be.

 

Summary
Go Module Proxy Options and What GOPROXY Actually Verifies
Article Name
Go Module Proxy Options and What GOPROXY Actually Verifies
Description
A Go module proxy caches and routes, and the protocol verifies nothing about module content. See what GOPROXY, GOPRIVATE, and the checksum database decide.
Author
Publisher Name
TuxCare
Publisher Logo

Join 4,500+ Linux & Open Source Professionals!

2x a month. No spam.

Table of Contents
Get the open-source security answers you need

Join 4,500+ Linux & Open Source Professionals!

2x a month. No spam.