Check go.mod for vulnerable dependencies
Upload or paste your go.mod. We check every Go package version in it
against OSV.dev and email you the
vulnerable ones, the version that fixes them and the Go modules command to upgrade. Free, and no account needed.
About go.mod
go.mod lists the modules your module requires, with their versions. Since Go 1.17 it also lists the indirect ones (marked // indirect), so it records the versions your build uses.
To write or refresh it:
go mod tidy
go.sum, next to it, holds checksums; it is not needed for this check.
Good to know
- Advisories for the Go standard library depend on your Go version, which this check does not know: keep your Go toolchain up to date as well.
- Each go.mod in a repository is its own module: check each one.
Fixing a vulnerable package
The report gives the fixed version for each vulnerable package (FIXED below). With Go modules:
# Upgrade one module
go get example.com/module@vFIXED
# Tidy go.mod and go.sum
go mod tidy
go get works the same way for an indirect module: Go then records the newer version in go.mod.
Then run your tests and commit the updated go.mod.
govulncheck ./... and this check
govulncheck, from the Go team, goes further: it checks whether your code actually calls the vulnerable functions. This check is quicker to run (nothing to install) and works for your other languages too.
Other lockfiles
Related free tools
GitHub repo vulnerability check
Paste a public GitHub repo URL. We find every lockfile, check each package version against OSV.dev and email you the fixes. Free, no account.
Dependency vulnerability check
Check requirements.txt, package-lock.json, poetry.lock and more against OSV.dev. Free report by email with fix commands. No account needed.
Last updated .