Skip to content

Docker image vulnerability scan fails: pip's bundled SBOM reports urllib3 2.7.0 #1278

Open

Description

@ahmed-hassan19

Description

The "Check vulnerabilities" workflow has failed on master since 2026-10-05
(https://github.com/geopython/pycsw/actions/runs/37389670863) and on every PR since, e.g.
https://github.com/geopython/pycsw/actions/runs/38883595661. The filesystem scan passes; the Docker image scan
reports 2 HIGH findings:

Python (python-pkg)
Total: 2 (HIGH: 2, CRITICAL: 0)
urllib3  CVE-2026-97687  HIGH  fixed  2.7.0  2.8.0
         CVE-2026-97689

The image's own urllib3 is already 2.8.0 (/venv/lib/python3.12/site-packages/urllib3-2.8.0.dist-info, 0 findings).
The 2.7.0 comes from pip: the Dockerfile upgrades pip in /venv to 26.2.1, which vendors urllib3 2.7.0 and ships a
CycloneDX SBOM at /venv/lib/python3.12/site-packages/pip/_vendor/bom.cdx.json. Trivy reads that SBOM (the log
warns "Third-party SBOM may lead to inaccurate vulnerability detection"). The same SBOM also lists msgpack 1.1.2 and
setuptools 70.3.0, which are the two entries added to .trivyignore in #1256.

pycsw does not use pip at runtime (docker/entrypoint.py, the compose, helm and kubernetes setups do not call it).

Two options:

a) Uninstall pip from /venv in the runtime image, and keep it when BUILD_DEV_IMAGE=true. This removes the
finding from the image instead of hiding it, and future CVEs in pip's vendored packages cannot recur. It also
makes the two existing .trivyignore entries unnecessary (I checked that the scan passes without them), so the
PR would remove them too.
b) Add CVE-2026-97687 and CVE-2026-97689 to .trivyignore, as in #1256.

I suggest (a) and can send a PR (one line in the Dockerfile, and the two .trivyignore entries removed). Behaviour change: images built FROM geopython/pycsw
that call /venv/bin/pip would need to build with BUILD_DEV_IMAGE=true, run /venv/bin/python3 -m ensurepip
first, or use the system pip with --python /venv/bin/python3.

The dev workflow in docs/docker.rst (docker exec --user root pycsw-dev pip3 install ...) is not affected: /venv/bin
is not on PATH, so pip3 there is the system pip:

$ docker run --rm --entrypoint sh <image> -c 'command -v pip3; python3 -m pip --version'
/usr/local/bin/pip3
pip 25.0.1 from /usr/local/lib/python3.12/site-packages/pip (python 3.12)

Environment

  • operating system: Debian 13 (python:3.12-slim-trixie base image); reproduced on macOS with Docker, linux/amd64
  • Python version: 3.12
  • pycsw version: master (ed86544)
  • source/distribution
    • git clone
    • DebianGIS/UbuntuGIS
    • PyPI
    • zip/tar.gz
    • other (please specify):
  • web server
    • Apache/mod_wsgi
    • CGI
    • other (please specify):

Steps to Reproduce

docker buildx build --platform linux/amd64 --load -t pycsw:test -f Dockerfile .
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$PWD":/src -w /src aquasec/trivy:0.70.0 \
  image --exit-code 1 --ignore-unfixed --severity CRITICAL,HIGH --pkg-types os,library pycsw:test

Exit code 1, with the urllib3 2.7.0 findings above. With /venv/bin/pip3 uninstall --yes pip added after
pip3 install -e . in the Dockerfile, the same scan exits 0, and the container still serves /collections.

Additional Information

Related: #1256 (.trivyignore), #1252, #1255, #1265.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions