CVE-2026-102267: PyJWT: PyJWKClient follows redirects when fetching JWKS
Summary PyJWT 2.13.0 PyJWKClient followed HTTP redirects while fetching a JWKS, without validating the redirect destination. A configured trusted endpoint could therefore redirect the client to a different host. Impact When an application uses PyJWKClient with caller-supplied request headers and an attacker can influence the configured endpoint's response, the redirected request could expose those headers and the…
Published Sep 29, 2026
Affected packages
PyJWT
- Ecosystem
- PyPI
- Affected
- <= 2.13.0
- Fixed in
- 2.14.0
- Check
pip show PyJWT
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
PyJWT 2.13.0 PyJWKClient followed HTTP redirects while fetching a JWKS, without validating the redirect destination. A configured trusted endpoint could therefore redirect the client to a different host.
Impact
When an application uses PyJWKClient with caller-supplied request headers and an attacker can influence the configured endpoint's response, the redirected request could expose those headers and the redirected response could be used as authoritative key material. This could cause JWKS trust poisoning and, in affected mixed-configuration applications, forged JWT acceptance. The issue requires an attacker-influenced redirect from the configured JWKS endpoint; it is not triggered by a token kid alone.
Affected versions
PyJWT <= 2.13.0.
Fix
The issue is fixed on master in commit `0a795b8e1f6ef08f634aa7086fc41cc6d5ce3e56`. PyJWKClient now disables automatic redirects for JWKS fetches. Regression tests verify that a redirect is rejected without contacting its destination, while normal fetches, headers, caching, errors, timeouts, and SSL context remain covered.
The fix is present in the unreleased development branch. The patched version will be recorded after a released PyJWT 2.x version containing the fix is confirmed.
Credit
Credit: the original reporter of GHSA-9v7f-9g4p-ffgj. Additional redirect header-leak and cache-poisoning evidence from the newer duplicate report GHSA-43g3-98cx-x446 is preserved in the duplicate record and informed this canonical advisory update.
Maintainer update — 2026-09-11
The verified fix for this advisory is included in PyJWT 2.14.0, released on 2026-09-11 and available on PyPI. PyJWT 2.14.0 is the first release containing the fix. This advisory is now published with 2.14.0 recorded as the patched version.
Credited to NovaHunter06.
References
- https://github.com/jpadilla/pyjwt/security/advisories/GHSA-9v7f-9g4p-ffgj
- https://nvd.nist.gov/vuln/detail/CVE-2026-102267
- https://github.com/jpadilla/pyjwt/commit/0a795b8e1f6ef08f634aa7086fc41cc6d5ce3e56
- https://github.com/jpadilla/pyjwt/releases/tag/2.14.0
- https://github.com/advisories/GHSA-9v7f-9g4p-ffgj
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-102275
PyJWT accepts inconsistent OKP x/d JWKs, causing public/private key identity confusion
medium6.5Oct 5, 2026CVE-2026-101918
PyJWT: Unauthenticated RecursionError DoS in pre-verification payload parse (PyJWKClient.get_signing_key_from_jwt / verify_signature=False)
medium5.3Sep 30, 2026CVE-2026-103001
PyJWT.decode() reintroduces options-dict mutation, enabling silent claim-verification bypass on dict reuse
medium6.5No fixSep 30, 2026CVE-2026-102266
PyJWT: PyJWK accepts empty HMAC keys, bypassing PyJWT's empty-key validation
high7.4Sep 29, 2026CVE-2026-102268
PyJWT: Asymmetric-PEM detection bypass: whitespace/line-ending-mutated public keys skip the HS/asymmetric confusion guard
critical9.1Sep 29, 2026CVE-2026-102269
PyJWT: Non-canonical signature segments enable raw-token revocation bypass
medium4.8Sep 29, 2026
