Skip to content

fix(python-jwt): upgrade to 2.15.1 to address CVEs - #20301

Open
Kanishk Bansal (Kanishk-Bansal) wants to merge 1 commit into
4.0from
python-jwt-patchlevel-cves
Open

Kanishk Bansal (Kanishk-Bansal) wants to merge 1 commit into
4.0from
python-jwt-patchlevel-cves

Conversation

@Kanishk-Bansal

@Kanishk-Bansal Kanishk Bansal (Kanishk-Bansal) commented Nov 15, 2026 •

Copy link
Copy Markdown

Summary

Upgrade python-jwt (PyJWT) from 2.8.0 to upstream 2.15.1 with a version overlay on the current Fedora f43 spec (f43 ships 2.8.0, f44 ships 2.10.1). This replaces #20034, which pinned rawhide. Rawhide's spec is not used; the only other spec edits are the ones the new sdist needs. Upstream diff: 2.8.0...2.15.1.

CVEs addressed (13)

CVE Severity How the fix was verified
CVE-2026-32597 High GHSA-752w-5fwx-jx9f (unknown crit header extensions): affected < 2.11.0, patched in 2.12.0
CVE-2026-48522 Medium GHSA-993g-76c3-p5m4 (PyJWKClient URI scheme SSRF): affected <= 2.12.1, patched in 2.13.0
CVE-2026-48524 Low GHSA-fhv5-28vv-h8m8 (unbounded JWKS requests via kid): affected <= 2.12.1, patched in 2.13.0
CVE-2026-48525 Medium GHSA-w7vc-732c-9m39 (unbounded Base64URL decode with b64=false): affected >= 2.8.0, <= 2.12.1, patched in 2.13.0
CVE-2026-48526 High GHSA-xgmm-8j9v-c9wx (public-key JWK accepted as HMAC secret): affected <= 2.10.1, patched in 2.13.0
CVE-2026-101917 Medium GHSA-2gx3-rcp4-g85q (JWKS fetch amplification, incomplete fix of CVE-2026-48524): affected <= 2.13.0, patched in 2.14.0
CVE-2026-101918 Medium GHSA-42vr-xj54-vc7v (RecursionError DoS in get_signing_key_from_jwt): affected >= 2.0.0a1, <= 2.14.0, patched in 2.15.0
CVE-2026-102267 High GHSA-9v7f-9g4p-ffgj (PyJWKClient follows redirects): affected <= 2.13.0, patched in 2.14.0
CVE-2026-102268 Critical GHSA-ffc3-869f-jxw9 (whitespace-mutated PEM keys skip the HMAC guard): affected <= 2.13.0, patched in 2.14.0
CVE-2026-102269 Medium GHSA-hxm8-2xgr-2p9m (non-canonical signature segments): affected <= 2.13.0, patched in 2.14.0
CVE-2026-102270 Medium GHSA-jwrc-g2q2-pq5p (ReDoS in is_pem_format): affected <= 2.13.0, patched in 2.14.0
CVE-2026-102271 High GHSA-p4g4-x82p-q773 (DER public keys accepted as HMAC secrets): patched in 2.14.0
CVE-2026-102275 Medium GHSA-x33g-cr3x-6449 (inconsistent OKP x/d JWKs): affected >= 2.1.0, <= 2.14.0, patched in 2.15.0

Notes

  • Spec edits beyond Version, all forced by the 2.15.1 sdist:
    • The sdist and its top directory are lower case (pyjwt-2.15.1), so srcname is pyjwt.
    • The setup.cfg edits in %prep are removed: 2.15.1 builds from pyproject.toml and ships no setup.cfg.
    • Test requirements moved from the tests extra to a dependency group that pins coverage and pytest versions, so %pyproject_buildrequires only generates the crypto extra and python3-pytest is added as a BuildRequires.
    • Two new tests are deselected: test_ec_curve_validation_rejects_p192_for_es256 and test_ec_curve_validation_with_pem_key load a P-192 key to check that ES256 rejects it, and the system OpenSSL does not support P-192 at all (Curve 1.2.840.10045.3.1.1 is not supported).
  • Compatibility: the 2.9 to 2.15 changes are mostly stricter validation (rejecting unsafe keys, URL schemes, headers) plus Python version support. The runtime consumers in 4.0 are python3-pygithub (pyjwt >= 2.4) and python3-azure-cli-core (pyjwt >= 2.1); both import fine with 2.15.1 and pygithub's GitHub App JWT signing works (checked in the 4.0 chroot).
  • Not claimed here: CVE-2022-39227 is for the unrelated davedoesdev/python-jwt project, and CVE-2026-102265 only affects PyJWT 2.13.0. Both are dispute candidates.
  • The sdist matches the PyPI SHA-256. The old PyJWT-2.8.0.tar.gz checksum is removed from sources by the overlay.

Changes

  • base/comps/components.toml: drop the inline python-jwt entry.
  • base/comps/python-jwt/python-jwt.comp.toml: pin the 2.15.1 sdist.
  • base/comps/python-jwt/overlays/0001-update-to-2.15.1.overlay.toml: Version, srcname, %prep, BuildRequires, %check, and old checksum.
  • locks/python-jwt.lock, specs/p/python-jwt/: regenerated by azldev.

Testing

  • PR check scratch package build passed: build 1257164. Control Tower built python-jwt for the 4.0 environment at the PR head f9a56ad332 in about 6 min.
  • Lock and render drift checks passed; azldev comp update --check-only is clean.
  • The new NVR is higher than what is published for 4.0 today.
  • Built locally in mock (x86_64): python3-jwt and python3-jwt+crypto 2.15.1-11; %check: 467 passed, 4 skipped, 4 deselected. Smoke test in the 4.0 chroot: HS256 encode/decode works, and python3-pygithub (GitHub App JWT signing) and python3-azure-cli-core import and work with 2.15.1.

Fedora f43 ships PyJWT 2.8.0 and f44 ships 2.10.1. Update to upstream
2.15.1 with a version overlay on the current f43 spec. The only other
spec changes are the ones the new sdist needs: it is published as
pyjwt-2.15.1.tar.gz, it has no setup.cfg any more, and its test
requirements are a dependency group instead of the "tests" extra, so
pytest is listed as a BuildRequires.

Addresses CVE(s):
CVE-2026-32597, CVE-2026-48522, CVE-2026-48524, CVE-2026-48525,
CVE-2026-48526, CVE-2026-101917, CVE-2026-101918, CVE-2026-102267,
CVE-2026-102268, CVE-2026-102269, CVE-2026-102270, CVE-2026-102271,
CVE-2026-102275
@Kanishk-Bansal Kanishk Bansal (Kanishk-Bansal) added security CVE-fixed-by-upgrade CVE fixed by package upgrade 4.0 Issues and PRs for Azure Linux 4.0 targets-4.0 labels Nov 15, 2026
Copilot AI balanced review requested due to automatic review settings November 15, 2026 07:20
@Kanishk-Bansal

Copy link
Copy Markdown
Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

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.

🔵 Needs a closer look

The security-sensitive PyJWT upgrade changes JWT validation and test dependencies, while this PR’s Fedora 43 RPM build, inspection, and isolated downstream smoke-test results remain pending and require human verification.

No open issues 🎉

What changed in this PR

Upgrades Azure Linux’s python-jwt (PyJWT) from 2.8.0 to 2.15.1 to address reported vulnerabilities, retaining the Fedora 43 spec rather than switching to rawhide.

Changes:

  • Moves the component into a dedicated definition with a checksum-pinned source archive.
  • Adds overlays for the new source layout, build requirements, and P-192 test exclusions.
  • Updates the lock fingerprint, rendered spec, and source checksum.
File Description
specs/​p/​python-jwt/​sources Replaces the old archive checksum with 2.15.1’s checksum.
specs/​p/​python-jwt/​python-jwt.spec Reflects the version upgrade and build/test adjustments.
locks/​python-jwt.lock Refreshes the component input fingerprint.
base/​comps/​python-jwt/​python-jwt.comp.toml Defines the component’s new source archive and checksum.
base/​comps/​python-jwt/​overlays/​0001-update-to-2.15.1.overlay.toml Adapts the Fedora spec for the newer release.
base/​comps/​components.toml Removes the inline entry now defined separately.

Review effort: Balanced

@Kanishk-Bansal
Kanishk Bansal (Kanishk-Bansal) marked this pull request as ready for review November 15, 2026 10:49

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

4.0 Issues and PRs for Azure Linux 4.0 CVE-fixed-by-upgrade CVE fixed by package upgrade security targets-4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants