Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/vuln: govulncheck reports no vulnerabilities while deps.dev reports two vulns #54970

Closed
thediveo opened this issue Sep 9, 2022 · 7 comments
Assignees
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. vulncheck or vulndb Issues for the x/vuln or x/vulndb repo
Milestone

Comments

@thediveo
Copy link

thediveo commented Sep 9, 2022

What version of Go are you using (go version)?

$ go version
go version go1.19 linux/amd64

Does this issue reproduce at the latest version of golang.org/x/vuln?

Yes: v0.0.0-20220908210932-64dbbd7bba4f

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/xxx/.cache/go-build"
GOENV="/home/xxx/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/xxx/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/xxx/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/snap/go/9951"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/snap/go/9951/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1004740596=/tmp/go-build -gno-record-gcc-switches"

What did you do?

  1. go install golang.org/x/vuln/cmd/govulncheck@latest
  2. git clone https://github.com/thediveo/sealwatcher
  3. cd sealwatcher
  4. govulncheck ./...
  5. Navigate to https://deps.dev/go/github.com%2Fthediveo%2Fsealwatcher/v0.8.1

What did you expect to see?

The reports of running govulncheck and https://deps.dev/go/github.com%2Fthediveo%2Fsealwatcher/v0.8.1 to match each other.

What did you see instead?

@thediveo thediveo added the vulncheck or vulndb Issues for the x/vuln or x/vulndb repo label Sep 9, 2022
@gopherbot gopherbot added this to the Unreleased milestone Sep 9, 2022
@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 9, 2022
@mknyszek
Copy link
Contributor

mknyszek commented Sep 9, 2022

CC @golang/vulndb

@zpavlinovic zpavlinovic self-assigned this Sep 9, 2022
@zpavlinovic
Copy link
Contributor

Thank you for reporting this! We can see that the module github.com/containers/buildah has been imported at a version where some vulnerabilities exist, which is why perhaps deps.dev is reporting it.

It seems however that govulncheck was not able to conclude that any of these vulnerabilities are in fact exercised by sealwatcher.

I can see by a manual inspection that a vulnerability can be exercised when the exported Builder.Run method of github.com/containers/buildah is called, but sealwatcher seems to only transitively call members of github.com/containers/buildah/define package, which seems is not calling Builder.Run.

This manual analysis could be wrong as we are not that familiar with the sealwatcher code. Is your understanding perhaps different?

@thediveo
Copy link
Author

thediveo commented Sep 9, 2022

@zpavlinovic your reason is 100% correct. There are no calls to Builder.Run; sealwatcher is only watching. Unit tests only use the REST API client calls, so no call path here either.

@thediveo
Copy link
Author

thediveo commented Sep 9, 2022

What are the expectations regarding the CLI govulncheck versus the deps site? Are they expected to do different reasoning? If so, is this documented somewhere, so devs are aware of different targets?

@seankhliao
Copy link
Member

From both the announcement blogpost:

Govulncheck analyzes your codebase and only surfaces vulnerabilities that actually affect you, based on which functions in your code are transitively calling vulnerable functions

and package docs:

Govulncheck reports known vulnerabilities that affect Go code. It uses static analysis of source code or a binary's symbol table to narrow down reports to only those that could affect the application.

@zpavlinovic
Copy link
Contributor

zpavlinovic commented Sep 9, 2022

I am personally not aware of the inner-workings of the deps.dev site but some information is provided at the bottom of https://deps.dev/.

Regarding govulncheck, I can only reiterate what @seankhliao has referenced: govulncheck is using call graph reasoning to figure out if vulnerabilities are actually called by your code. Thanks @seankhliao!

@seankhliao
Copy link
Member

deps.dev on dependency

The Insights project provides the package owner view, the complete dependency graph someone maintaining the package would need. At the moment there is no ability to control which classes of dependencies are included.

They include everything from the module graph.

I think this can be closed as working as intended.

@zpavlinovic zpavlinovic modified the milestones: Unreleased, vuln/2022 Sep 9, 2022
@julieqiu julieqiu changed the title x/vuln: govulncheck reports no vulnerabilities while open/source/insights reports two vulns x/vuln: govulncheck reports no vulnerabilities while deps.dev reports two vulns Sep 9, 2022
@julieqiu julieqiu closed this as completed Sep 9, 2022
@julieqiu julieqiu removed the x/vuln label Sep 10, 2022
@golang golang locked and limited conversation to collaborators Sep 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. vulncheck or vulndb Issues for the x/vuln or x/vulndb repo
Projects
None yet
Development

No branches or pull requests

6 participants