-
Notifications
You must be signed in to change notification settings - Fork 897
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
GODRIVER-2446 Update Fixable Dep Vulnerabilities, Identify Un-Fixable Dep Vulnerabilities #1005
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 . Thanks for the thorough description of the updates!
// gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c introduced through github.com/stretchr/testify@v1.6.1 are | ||
// vulnerable to Denial of Service (DoS) via the Unmarshal function, which causes the program to crash when attempting | ||
// to deserialize invalid input. https://www.cve.org/CVERecord?id=CVE-2022-28948 | ||
replace gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c => gopkg.in/yaml.v3 v3.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthewdale as you've noted, updating to a version of testify that resolves CVE-2022-28948 is not something we can do without breaking support for Go v10. Using replace updates the vulnerable yaml.v3 version to 3.0.1, which removes it from go.sum. However, the testify package still points to v3.0.0-20200313102051-9f266ea9e77c
in the dependency graph:
github.com/stretchr/testify@v1.6.1 gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's fine. The only version of gopkg.in/yaml.v3 in go.sum
seems to be v3.0.1, suggesting that replace
directive is preventing it from being part of the final dependency closure.
Wow thanks for the super thorough description! That move with the |
The x/crypto package does use a version of x/net that is vulnerable, it doesn't use the vulnerable functionality specifically. I emailed the Go team about this and their response was
The specific Snyk problem for x/net was due to x/tools, which we no longer import as a dependency: https://app.snyk.io/org/mongodb-default/project/d1fd28ee-07d4-4de7-88ed-e20dc42a307c#issue-SNYK-GOLANG-GOLANGORGXNETHTTP2-2313688 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. If the Go team says we're not using the vulnerable code with our current setup and Snyk is not complaining I think that's fine w me. Thanks!
go.mod
Outdated
@@ -7,6 +7,11 @@ retract ( | |||
[v1.6.0, v1.6.1] // Contains data race bug in background connection establishment. | |||
) | |||
|
|||
// gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c introduced through github.com/stretchr/testify@v1.6.1 are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c introduced through github.com/stretchr/testify@v1.6.1 are | |
// gopkg.in/yaml.v3@v3.0.0-20200313102051-9f266ea9e77c introduced through github.com/stretchr/testify@v1.6.1 is |
Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>
golang.org/x/net
GODRIVER-2448
CVE-2021-44716
We have two packages that use the net library:
golang.org/x/crypto
golang.org/x/tools
Updating both to latest respectively puts the dependency graphs at
and
According to Snyk the DOS vulnerability for
golang.org/x/net
is fixed inwhich means that neither of our latest dependencies resolves this problem, as our earliest version for the net library is
The root of this 2019 version is that
golang.org/x/tools
imports an older version of itself. This peculiarity results in the following dependency graph:The only place in our repo that uses x/tools is docbuilder. The goal of this package was to create a binary that generates HTML for package redirects, defined in GODRIVER-120. Since the go team no longer maintains this practice, we can deprecate the docbuilder and do only top-level redirects as requested in
TSOPS-4909HELP-35307ITSYSENG-5757.The x/crypto package still uses a vulnerable version of the net package:
To help get closer to resolving this, I've submitted an issue via the Go Security Policy:However, per the go team:
Given this issue is specifically concerning the use of x/net/http2, this vulnerability is resolved. It's also worth noting that the dependency update given by Snyk is specific to the x/tools package.
golang.org/x/text
GODRIVER-2447
CVE-2020-14040
This is a DOS vulnerability that is fixed in
golang.org/x/text@0.3.3
. The earliest version of thegolang.org/x/text
package in the Go Driver isgolang.org/x/text@v0.3.6
, which is a dependency ofgolang.org/x/crypto
:CVE-2021-38561
This no longer appears to be an issue on cve.org.
However, it is still a vulnarbility on Snyk that is fixed as ofthe question of CVE-2021-38561's effects on the x/crypto package is currently an open issue with their team. This is not, however, an issue reported by Snyk AFAIK.golang.org/x/text@v0.3.7
. In the Go Driver, this vulnerability is introduced bygolang.org/x/crypto
: https://cs.opensource.google/go/x/crypto/+/master:go.mod;l=11 andI've created [GODRIVER-2447|https://jira.mongodb.org/browse/GODRIVER-2477] to resolve this whenever the Go team's issue is closed.This is resolved by updating
github.com/xdg-go/stringprep
, per the dependency graph:golang.org/x/crypto
GODRIVER-2446
CVE-2020-9283
CVE-2020-29652
CVE-2022-27191
All three of these issues are resolved by updating
golang.org/x/crypto
to latest.gopkg.in/yaml.v3
GODRIVER-2448
CVE-2022-28948
This is resolved by upgrading gopkg.in/yaml.v3 to version 3.0.0 or higher. I believe replacing the effected version in the module will resolve this issue: https://go.dev/ref/mod#:~:text=A%20replace%20directive%20replaces%20the,a%20platform%2Dspecific%20file%20path.