Skip to content

[sonic-buildimage]: fix CRITICAL/HIGH CVEs in Go module dependencies - #28890

Open
qiluo-msft wants to merge 1 commit into
masterfrom
fix/cve-remediation-go-modules-2026-08
Open

[sonic-buildimage]: fix CRITICAL/HIGH CVEs in Go module dependencies#28890
qiluo-msft wants to merge 1 commit into
masterfrom
fix/cve-remediation-go-modules-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 of the sonic-buildimage source tree identified 9 CRITICAL and 150 HIGH severity vulnerabilities. This PR updates Go module dependencies in first-party SONiC submodules to remediate the most impactful CRITICAL and HIGH findings.

Work item tracking

N/A

How I did it

Updated submodule pointers for sonic-gnmi and sonic-mgmt-common to commits that upgrade vulnerable Go dependencies. See linked submodule PRs:

sonic-gnmi (sonic-net/sonic-gnmi#741)

sonic-mgmt-common (sonic-net/sonic-mgmt-common#237)

Known limitations

  • sonic-telemetry (Azure/sonic-telemetry) is archived/read-only
  • sonic-sysmgr/gnoi (openconfig/gnoi) is third-party with no push access

How to verify it

After submodule PRs are merged and this PR's submodule pointers are updated to the merge commits, run:

trivy fs src/sonic-gnmi --severity CRITICAL,HIGH
trivy fs src/sonic-mgmt-common --severity CRITICAL,HIGH

Which release branch to backport

  • 202405
  • 202411
  • master

Tested branch

Local Trivy scan on sonic-buildimage master

Description for the changelog

Remediate CRITICAL/HIGH CVEs: upgrade grpc, golang.org/x/{crypto,net,text}, and antchfx/xpath in sonic-gnmi and sonic-mgmt-common Go modules.

Copilot AI lite review requested due to automatic review settings August 6, 2026 22:50
@qiluo-msft
qiluo-msft requested a review from lguohan as a code owner August 6, 2026 22:50
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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 aims to remediate CRITICAL/HIGH CVEs in Go module dependencies by updating the submodule pins in sonic-buildimage so builds consume newer dependency sets from the corresponding upstream repositories.

Changes:

  • Bump src/sonic-gnmi submodule pointer.
  • Bump src/sonic-mgmt-common submodule pointer.
  • Bump src/sonic-sysmgr/gnoi submodule pointer.
  • Add a new src/sonic-telemetry gitlink (submodule pointer).

Key review findings (blocking):

  • The new submodule SHAs referenced for sonic-gnmi, sonic-mgmt-common, and gnoi are not resolvable in their respective upstream repos, which will break git submodule update --init and therefore the build.
  • src/sonic-telemetry is introduced as a new submodule, but there is no corresponding .gitmodules entry in this PR; submodule initialization/checkout will not work as-is.
  • Build rules in this repo already source “telemetry” from src/sonic-gnmi (not src/sonic-telemetry), and sonic-net/sonic-telemetry is archived/migrated—so adding a telemetry submodule does not appear to align with how this repo actually builds telemetry today.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/sonic-gnmi Updates the pinned submodule commit for sonic-gnmi.
src/sonic-mgmt-common Updates the pinned submodule commit for sonic-mgmt-common.
src/sonic-sysmgr/gnoi Updates the pinned submodule commit for the gNOI dependency.
src/sonic-telemetry Adds a new gitlink intended to pin sonic-telemetry.

Update submodule pointers for sonic-gnmi and sonic-mgmt-common to commits
that upgrade vulnerable Go dependencies.

Changes per submodule:
- sonic-gnmi: grpc v1.64.1->v1.82.1, x/crypto v0.24.0->v0.52.0,
  x/net v0.26.0->v0.55.0, x/text v0.16.0->v0.39.0,
  antchfx/xpath v1.1.10->v1.3.6 (CVE-2026-32287)
- sonic-mgmt-common: grpc v1.28.0->v1.82.1, x/text v0.3.3->v0.39.0,
  antchfx/xpath v1.1.10->v1.3.6 (direct dep)

Notes:
- sonic-telemetry (Azure/sonic-telemetry) is archived/read-only; fix applied locally only
- sonic-sysmgr/gnoi (openconfig/gnoi) is third-party; no push access
- Separate PRs needed in sonic-gnmi and sonic-mgmt-common submodule repos

CVEs fixed: CVE-2026-33186, GHSA-hrxh-6v49-42gf, CVE-2026-32287,
CVE-2024-45337, CVE-2025-22869, CVE-2026-39828-39832, CVE-2023-39325,
CVE-2024-45338, CVE-2026-25681, CVE-2026-33814, CVE-2026-39821,
CVE-2020-14040, CVE-2021-38561, CVE-2022-32149, CVE-2026-56852

Signed-off-by: qiluo <qiluo@microsoft.com>
Copilot AI review requested due to automatic review settings August 6, 2026 23:29
@qiluo-msft
qiluo-msft force-pushed the fix/cve-remediation-go-modules-2026-08 branch from 818293e to c867d30 Compare August 6, 2026 23:29
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

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