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

CVE-2021-3121 - gogo/protobuf #6429

Closed
anshulahuja98 opened this issue Jun 28, 2023 · 4 comments
Closed

CVE-2021-3121 - gogo/protobuf #6429

anshulahuja98 opened this issue Jun 28, 2023 · 4 comments

Comments

@anshulahuja98
Copy link
Collaborator

What steps did you take and what happened:

Our component governance tool is flagging gogo/protobuf (1.1.1, 1.2.1, 1.3.1) due to the CVE-2021-3121

CVE Description: An issue was discovered in GoGo Protobuf before 1.3.2. plugin/unmarshal/unmarshal.go lacks certain index validation, aka the "skippy peanut butter" issue.

Currently in go.sum: it is present at following place: https://github.com/vmware-tanzu/velero/blob/de83980a05059f0e41ed00f1cf0ef061a9ebc049/go.sum#L297C1-L299C87

We fixed it for some of our repos by adding the following redirect in go.mod

replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

  • 👍 for "I would like to see this bug fixed as soon as possible"
  • 👎 for "There are more important bugs to focus on right now"
blackpiglet pushed a commit to blackpiglet/velero that referenced this issue Jul 3, 2023
Remove CVE-2021-3121 affected github.com/gogo/protobuf version from go.sum

Signed-off-by: Xun Jiang <[email protected]>
blackpiglet pushed a commit to blackpiglet/velero that referenced this issue Jul 3, 2023
Remove CVE-2021-3121 affected github.com/gogo/protobuf version from go.sum

Signed-off-by: Xun Jiang <[email protected]>
This was referenced Jul 3, 2023
@sseago
Copy link
Collaborator

sseago commented Jul 3, 2023

This seems to be a false positive. As of go 1.17, all direct and indirect dependencies are included in go.mod. go.sum lists every dependency of every package prior to package version resolution, so multiple versions can be listed. Only one version of a package will be built, though, and that version should be specified in go.mod:

$ grep gogo go.mod 
	github.com/gogo/protobuf v1.3.2 // indirect

Also, go list -m all will list all modules for the build list, again only the (fixed) version is included:

$ go list -m all|grep gogo
github.com/gogo/protobuf v1.3.2

I also confirmed this by running go mod vendor locally:

$ grep gogo vendor/modules.txt 
# github.com/gogo/protobuf v1.3.2
github.com/gogo/protobuf/proto
github.com/gogo/protobuf/sortkeys

Note that Dependabot has stopped using go.sum for vulnerability scanning as well: https://github.blog/changelog/2023-03-07-dependency-graph-removes-go-sum-support/

@sseago
Copy link
Collaborator

sseago commented Jul 3, 2023

Also, if you check PR/issue history, we fixed this CVE a while back, which is why the currently-included package for the build is the fixed version. I'd rather avoid replace directives when they're unnecessary as then later if a package requires a newer version of this package, the replace becomes a forced downgrade, which could introduce unexpected behavior or bugs.

@anshulahuja98
Copy link
Collaborator Author

Thank you for explaining this in detail! We will check with our scanning tools.

@blackpiglet
Copy link
Contributor

Close for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants