Skip to main content
MediumSupply chainOWASP A05:2021CWE-200

How to fix: Go go.sum Checksum File Exposed

A go.sum file was found publicly accessible with multiple module checksum entries. This file lists every module in the build, including indirect dependencies, along with the exact version resolved for each.

Why it matters

Exact module versions let an attacker check the Go vulnerability database (govulncheck/OSV) for applicable CVEs in the resolved dependency tree, including indirect modules that never appear in go.mod.

go.sum is a build-time artifact that should live in the source repository, not the web root. It typically becomes reachable when a container image or deployment copies the whole module directory instead of just the compiled binary.

How to fix it

  1. 1Block access to go.sum and go.mod in your web server configuration.
  2. 2Use a multi-stage Docker build so the final image contains only the compiled binary, not the Go module cache or source tree.
  3. 3Verify your deployment artifact doesn't include the repository checkout.

Code examples

Multi-stage Docker build excludes source/module files from the final image

DOCKERFILE
FROM golang:1.22 AS build
WORKDIR /src
COPY . .
RUN go build -o /app ./cmd/server

FROM gcr.io/distroless/base-debian12
COPY --from=build /app /app
# go.sum, go.mod, and source files never reach this final image
ENTRYPOINT ["/app"]

References

Detected automatically by VulnRadar. The check id is supply-chain-go-sum-exposed, stable across every scan so you can filter or diff on it.

See every supply chain check

Questions

How severe is Go go.sum Checksum File Exposed?
VulnRadar rates this medium severity in the supply chain category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id supply-chain-go-sum-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Go go.sum Checksum File Exposed map to?
It maps to CWE-200. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for go go.sum checksum file exposed

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: Go go.sum Checksum File Exposed | VulnRadar