go.sum and go.mod vulnerability scanner
Paste a go.sum or go.mod and find Go modules with known vulnerabilities from the Go vulnerability database and GitHub advisories, with the fixed version.
The file is read in your browser. Only package names and versions are sent to OSV when you scan.
This tool asks the OSV.dev vulnerability database directly from your browser. It sends the name, version and ecosystem of each package in the file, and then the IDs of the advisories that matched. The file itself, its paths, URLs and hashes stay in your browser, and nothing is sent to HardenKit.
How to use the go.sum and go.mod vulnerability scanner
- Paste your go.mod or go.sum, or drop the file on the page.
- Read the note that says which file it is and what that means for coverage.
- Press the scan button to send the module paths and versions to OSV.dev.
- Upgrade with go get module@version followed by go mod tidy, then scan again.
About this tool
A Go project has two dependency files, and they answer different questions. go.mod lists the module versions the build uses; since Go 1.17 that includes indirect dependencies. go.sum holds checksums for every module version Go had to look at while choosing versions, which is more than what ends up in the build. This scanner accepts either file and tells you which one it read.
From a go.mod it reads the require lines and applies replace rules, so a module you replaced with a fork is looked up as the fork. From a go.sum it keeps the versions whose code was downloaded and leaves out those with only a go.mod checksum. Versions are sent to OSV.dev without the leading v, as its Go records expect, and matched against the Go vulnerability database and GitHub advisories.
A hit means the module version is affected, not that your program calls the vulnerable function. Go’s own govulncheck goes further: it reads your source and reports only vulnerabilities your code can reach. Use this page for a quick look at a repository, and govulncheck in the project when you need to know what is reachable. The Go standard library is not covered here.
Sources
Questions
go.mod, when it was written by Go 1.17 or later: it lists exactly the module versions in the build. go.sum also contains versions that were only considered during version selection, so it can report vulnerabilities in code you do not build. Use go.sum when the go.mod is old and lists direct requirements only.
govulncheck analyzes your source code and call graph and reports only the vulnerabilities your program can reach, including those in the standard library. This scanner matches module versions only. It needs no Go toolchain and no source, at the price of more findings that may not apply.
A pseudo-version such as v0.0.0-20200622213623-75b288015ac9 is sent as it is, without the v, and OSV.dev compares it by its timestamp. The +incompatible suffix is build metadata that does not take part in version order, so it is removed before the lookup.
The Go team and GitHub often publish separate records for one vulnerability, a GO- ID and a GHSA- ID, which name each other as aliases. The scanner merges them into one row and shows the severity from whichever record states one.