Skip to content

fix: upgrade vulnerable Go dependencies to fix CRITICAL/HIGH CVEs - #741

Closed
qiluo-msft wants to merge 2 commits into
masterfrom
fix/cve-gnmi-master-2026-08
Closed

fix: upgrade vulnerable Go dependencies to fix CRITICAL/HIGH CVEs#741
qiluo-msft wants to merge 2 commits into
masterfrom
fix/cve-gnmi-master-2026-08

Conversation

@qiluo-msft

@qiluo-msft qiluo-msft commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

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.mod with the following version bumps:

Package Old New CVEs Fixed
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-2025-47913, CVE-2026-39828–39832
golang.org/x/net v0.38.0 v0.55.0 CVE-2023-39325, CVE-2023-45288, CVE-2024-45338, CVE-2026-25681, CVE-2026-27136, CVE-2026-33814, CVE-2026-39821
golang.org/x/text v0.23.0 v0.39.0 CVE-2026-56852
github.com/antchfx/xpath v1.1.10 v1.3.6 CVE-2026-32287
github.com/antchfx/jsonquery v1.1.4 v1.3.7 (parent of vulnerable xpath)
github.com/antchfx/xmlquery v1.3.1 v1.5.1 (parent of vulnerable xpath)

Also updated the replace directives for golang.org/x/crypto and google.golang.org/grpc to match the upgraded versions.

How to verify it

trivy fs . --severity CRITICAL,HIGH

CRITICAL count should drop to 0; HIGH count should decrease substantially.

- 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>
Copilot AI lite review requested due to automatic review settings August 6, 2026 23:39
@mssonicbld

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/grpc to v1.82.1 and golang.org/x/crypto / golang.org/x/net to newer releases.
  • Upgraded indirect antchfx/jsonquery, antchfx/xmlquery, and antchfx/xpath versions.
  • Updated replace directives for grpc and x/crypto to match the new target versions.
Suppressed comments (1)

go.mod:82

  • The replace directives still force some modules to versions that differ from require (e.g., google.golang.org/protobuf is required at v1.36.6 but replaced with v1.34.1; golang.org/x/sys is 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 thread go.mod
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
@mssonicbld

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
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.

@qiluo-msft

Copy link
Copy Markdown
Collaborator Author

Superseded by updated PR with rebase on latest master.

@qiluo-msft qiluo-msft closed this Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants