Skip to content

ci: fix s360 security vulnerability#25876

Open
auspham wants to merge 1 commit intosonic-net:masterfrom
auspham:austinpham/36979761-s360-resolve
Open

ci: fix s360 security vulnerability#25876
auspham wants to merge 1 commit intosonic-net:masterfrom
auspham:austinpham/36979761-s360-resolve

Conversation

@auspham
Copy link
Contributor

@auspham auspham commented Mar 4, 2026

Why I did it

Due to the recent s360 vulnerability reports. This PR is needed to address the problems. We have vulnerability in the follow image:

  1. docker-ptf
  2. debian
  3. docker-sonic-mgmt
Work item tracking
  • Microsoft ADO (number only): 36979761

How I did it

Apply the recommended version from security report

How to verify it

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@auspham auspham requested a review from lguohan as a code owner March 4, 2026 04:17
Copilot AI review requested due to automatic review settings March 4, 2026 04:17
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

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 address reported S360 security vulnerabilities by updating selected dependency versions used by the docker-ptf build and its published version manifest.

Changes:

  • Bump pip and setuptools versions in the docker-ptf py3 versions manifest.
  • Update docker-ptf image build inputs (grpcurl, ipython, tac_plus, protobuf pin, gnoic).
  • Update the gnxi patch to require a newer protobuf for gnmi_cli_py.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
files/build/versions-public/dockers/docker-ptf/versions-py3 Updates published python package versions for docker-ptf py3.
dockers/docker-ptf/gnxi-patches/0005-Enhance-gnmi_cli_py-4.patch Updates gnxi gnmi_cli_py requirements (protobuf) in the applied patch.
dockers/docker-ptf/Dockerfile.j2 Updates several pinned tool/component versions and adjusts protobuf pinning behavior.
Comments suppressed due to low confidence (1)

dockers/docker-ptf/Dockerfile.j2:115

  • This Dockerfile downloads the grpcurl binary directly from GitHub using curl and installs it into the image without any integrity verification (no checksum or signature check). If the upstream GitHub release or the network path is compromised, a malicious binary could be embedded into the container and later executed with its privileges. To harden the supply chain, pin this download to a specific immutable artifact and verify its integrity (for example by checking a known SHA-256 digest) before installing.
    && GRPCURL_VERSION=1.9.3 && \
    curl -L "https://github.com/fullstorydev/grpcurl/releases/download/v${GRPCURL_VERSION}/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz" \
      -o /tmp/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
    cd /tmp && \
    tar xvf grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
    mv grpcurl /usr/local/bin/grpcurl && \
    chmod +x /usr/local/bin/grpcurl && \

Signed-off-by: Austin Pham <austinpham@microsoft.com>
@auspham auspham force-pushed the austinpham/36979761-s360-resolve branch from f9428e8 to d9f6707 Compare March 4, 2026 04:58
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

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 4 out of 4 changed files in this pull request and generated 4 comments.

Comment on lines +31 to +35
pip==25.3
plumbum==1.10.0
prompt-toolkit==1.0.18
prompt_toolkit==3.0.52
protobuf==3.20.3
protobuf==5.29.5
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

PR description mentions addressing vulnerabilities in multiple images (docker-ptf, debian, docker-sonic-mgmt), but this change set appears to only touch docker-ptf-related version pins and a shared Dockerfile macro. Please either include the missing image updates or adjust the PR description/scope so it matches what’s actually being fixed.

Copilot uses AI. Check for mistakes.
+grpcio==1.41.1
+grpcio-tools==1.41.1
protobuf==3.6.1 --no-binary=protobuf
protobuf==3.18.3 --no-binary=protobuf
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

gnmi_cli_py/requirements.txt is pinned to protobuf==3.18.3 (<=3.20.x), while other parts of this PR bump protobuf to 5.29.5. If gnmi_cli_py is used in the same environment as those other pins, pip will either error on dependency conflicts or silently downgrade protobuf. Please ensure the protobuf version strategy is consistent across docker-ptf (and that gnmi tests still work).

Suggested change
protobuf==3.18.3 --no-binary=protobuf
-protobuf==3.18.3 --no-binary=protobuf
+protobuf==5.29.5 --no-binary=protobuf

Copilot uses AI. Check for mistakes.
Comment on lines 292 to 299
# gnxi/gnmi_cli_py requires protobuf 3.20.x or lower
# Bookworm by default use 5.29.x. Resetting it to 3.20.3
# Bookworm by default use 5.29.x. Resetting it to 5.29.5
# to avoid issues with gnmi tests.
RUN set -e; \
. /etc/os-release; \
if [ "$VERSION_CODENAME" = "bookworm" ]; then \
pip install protobuf==3.20.3; \
pip install protobuf==5.29.5; \
else \
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The protobuf pin here contradicts the preceding comment and likely breaks the stated gnxi/gnmi_cli_py requirement ("protobuf 3.20.x or lower"). Currently Bookworm is forced to protobuf==5.29.5, which is >3.20.x; please either (a) keep protobuf pinned to a compatible <=3.20.x version, or (b) update gnxi/gnmi_cli_py (and the comment) to be compatible with protobuf 5.29.x so gnmi tests won’t fail.

Copilot uses AI. Check for mistakes.
prompt-toolkit==1.0.18
prompt_toolkit==3.0.52
protobuf==3.20.3
protobuf==5.29.5
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

This file now pins protobuf==5.29.5, but docker-ptf still contains logic/comments indicating gnxi/gnmi_cli_py requires protobuf 3.20.x or lower. If docker-ptf’s runtime environment is expected to support gnmi tests, these pins need to be aligned (either update gnxi to support 5.29.x, or keep protobuf pinned to <=3.20.x here).

Suggested change
protobuf==5.29.5
protobuf==3.20.3

Copilot uses AI. Check for mistakes.
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