Skip to content

CI: fail jobs that run an unpatched CPython interpreter - #3259

Draft
juenglin wants to merge 1 commit into
NVIDIA:mainfrom
juenglin:ci-check-python-patched
Draft

juenglin wants to merge 1 commit into
NVIDIA:mainfrom
juenglin:ci-check-python-patched

Conversation

@juenglin

Copy link
Copy Markdown
Contributor

Description

Refs #3195

The Python releases 3.15.2, 3.14.10, 3.13.18, 3.12.16 and 3.11.18 (announcement, CVE-2026-115557) make the ssl module reject the compromised eMudhra intermediate keys. An older interpreter on a runner (for example a stale tool cache) silently keeps trusting them, and nothing in CI notices.

This PR makes harden-pip check the interpreter first. The new check_python_patched.py prints sys.version and fails when the interpreter is older than the first fixed release of its minor series:

Series First fixed release
3.11 3.11.18
3.12 3.12.16
3.13 3.13.18
3.14 3.14.10
3.15 3.15.2
  • Any release at or after the fixed one passes. The free-threaded builds (3.14t, 3.15t) report the same version tuple.
  • A pre-release of a series with a known fix fails, and so does 3.10 or older (no fixed release exists).
  • Series newer than 3.15 (3.16 pre-releases) pass with a ::warning::, because no fixed release is known there yet. Extend FIXED_MICRO once one exists.

The check lives in harden-pip because nearly every job that sets up Python calls it right after setup-python (wheel builds and tests, coverage, sdist tests, release, pre-commit, lychee, nightly). The script sits next to the action and runs through GITHUB_ACTION_PATH, so it matches the action's commit at the call sites that use $/.github/actions/harden-pip.

Not covered: the uv-based jobs (bandit, griffe-api-check), the Miniforge docs build, and the Python inside the cibuildwheel containers.

The actions/python-versions manifest used by setup-python already lists all five fixed releases as stable. Self-hosted runners that serve setup-python from /opt/hostedtoolcache will fail the check if they still carry an older patch release, which is the intended outcome.

Also adds .github/actions/** to the T201 (print) per-file ignores in ruff.toml, matching ci/**.

Checklist

  • New or existing tests cover these changes. (ci/tools/tests/test_check_python_patched.py; the action step is exercised by every job that calls harden-pip.)
  • The documentation is up to date with these changes.

Print sys.version in the harden-pip action and fail when the interpreter
is older than the first release of its minor series that rejects the
compromised eMudhra/emSign intermediate CA keys.
@juenglin juenglin added this to the cuda.bindings next milestone Oct 27, 2026
@juenglin juenglin added the CI/CD CI/CD infrastructure label Oct 27, 2026
@juenglin juenglin self-assigned this Oct 27, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

This branch has not been deployed

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

Labels

CI/CD CI/CD infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant