fix: upgrade vulnerable Go dependencies to fix CRITICAL/HIGH CVEs - #741
Closed
qiluo-msft wants to merge 2 commits into
Closed
fix: upgrade vulnerable Go dependencies to fix CRITICAL/HIGH CVEs#741qiluo-msft wants to merge 2 commits into
qiluo-msft wants to merge 2 commits into
Conversation
- google.golang.org/grpc v1.69.2 -> v1.82.1 (CVE-2026-33186, GHSA-hrxh-6v49-42gf) - golang.org/x/crypto v0.36.0 -> v0.52.0 (CVE-2024-45337, CVE-2025-22869, CVE-2026-39828-39832) - golang.org/x/net v0.38.0 -> v0.55.0 (CVE-2023-39325, CVE-2024-45338, CVE-2026-25681, CVE-2026-33814) - golang.org/x/text v0.23.0 -> v0.39.0 (CVE-2026-56852) - antchfx/xpath v1.1.10 -> v1.3.6 (CVE-2026-32287) - antchfx/jsonquery v1.1.4 -> v1.3.7 (parent of vulnerable xpath) - antchfx/xmlquery v1.3.1 -> v1.5.1 (parent of vulnerable xpath) Also update replace directives for grpc and crypto to match. Signed-off-by: qiluo <qiluo@microsoft.com>
Contributor
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
This was referenced Aug 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates sonic-gnmi’s Go module dependencies to address CRITICAL/HIGH vulnerabilities reported by Trivy by bumping several core golang.org/x/* libraries, google.golang.org/grpc, and the antchfx/* XML/JSON query chain.
Changes:
- Upgraded
google.golang.org/grpcto v1.82.1 andgolang.org/x/crypto/golang.org/x/netto newer releases. - Upgraded indirect
antchfx/jsonquery,antchfx/xmlquery, andantchfx/xpathversions. - Updated
replacedirectives forgrpcandx/cryptoto match the new target versions.
Suppressed comments (1)
go.mod:82
- The
replacedirectives still force some modules to versions that differ fromrequire(e.g.,google.golang.org/protobufis required at v1.36.6 but replaced with v1.34.1;golang.org/x/sysis required at v0.33.0 but replaced with v0.26.0). This can defeat dependency upgrades/security fixes and may cause incompatibilities with the new grpc version unless it is intentional and validated.
golang.org/x/sys => golang.org/x/sys v0.26.0
google.golang.org/grpc => google.golang.org/grpc v1.82.1
google.golang.org/protobuf => google.golang.org/protobuf v1.34.1
Comment on lines
+33
to
+35
| golang.org/x/crypto v0.52.0 | ||
| golang.org/x/net v0.55.0 | ||
| google.golang.org/grpc v1.82.1 |
Signed-off-by: qiluo <qiluo@microsoft.com>
Contributor
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
Collaborator
Author
|
Superseded by updated PR with rebase on latest master. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
Trivy CVE scan identified multiple CRITICAL and HIGH severity vulnerabilities in the Go module dependencies of sonic-gnmi.
How I did it
Updated
go.modwith the following version bumps:google.golang.org/grpcgolang.org/x/cryptogolang.org/x/netgolang.org/x/textgithub.com/antchfx/xpathgithub.com/antchfx/jsonquerygithub.com/antchfx/xmlqueryAlso updated the
replacedirectives forgolang.org/x/cryptoandgoogle.golang.org/grpcto match the upgraded versions.How to verify it
trivy fs . --severity CRITICAL,HIGHCRITICAL count should drop to 0; HIGH count should decrease substantially.