CVE-2026-102267: PyJWT: PyJWKClient follows redirects when fetching JWKS

Published Sep 28, 2026
·
Updated

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.

Other sources

PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, PyJWT PyJWKClient is affected because redirect destinations are not revalidated against the JWKS trust boundary. This occurs when a configured trusted JWKS endpoint returns an attacker-influenced redirect. As a result, PyJWKClient follows the redirect and consumes the redirected response as key material. Consequently, forwarded credentials may be disclosed or verification keys may be substituted. This issue is fixed in version 2.14.0.

— MITRE

PyJWT: PyJWKClient follows redirects when fetching JWKS

— Microsoft

Affected Software

5 affected componentsFixes available
pypi/pyjwt<2.14.0
pip/PyJWT<=2.13.0
2.14.0
Microsoft azl3 python-jwt 2.13.0-1<2.15.1-1
2.15.1-1
Pyjwt Project Pyjwt<2.14.0
debian/pyjwt<=2.6.0-1+deb12u1, <=2.10.1-2+deb13u1
2.15.1-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/PyJWT to a version that resolves this vulnerability.

    Fixed in 2.14.0
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.15.1-1
  3. Upgrade

    Upgrade debian/pyjwt to a version that resolves this vulnerability.

    Fixed in 2.15.1-1
  4. Upgrade

    Upgrade PyJWT to a version that resolves this vulnerability.

    Fixed in 2.14.0

Event History

Sep 28, 2026
CVE Published
via MITRE·08:23 PM
Data Sourced
via MITRE·08:23 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:17 PM
RemedyDescriptionSeverityWeaknessAffected Software
Sep 29, 2026
Advisory Published
via GitHub·11:15 PM
Data Sourced
via GitHub·11:15 PM
DescriptionSeverityWeaknessAffected Software
Sep 30, 2026
Data Sourced
via Microsoft·08:02 AM
DescriptionSeverityWeaknessAffected Software
Oct 14, 2026
Data Sourced
via Ubuntu·07:52 AM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Launchpad·07:53 AM
Description
Data Sourced
via Debian·07:53 AM
DescriptionAffected Software

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments using PyJWT PyJWKClient before version 2.14.0 are affected when they fetch keys from a configured trusted JWKS endpoint that can return an attacker-influenced redirect.

2

What does an attacker need to exploit it?

An attacker needs influence over a redirect returned by the configured JWKS endpoint. PyJWKClient then follows the redirect without revalidating the destination against the JWKS trust boundary.

3

What is the impact of a successful exploit?

Forwarded credentials may be disclosed to the redirect destination, or the redirected response may be consumed as key material, allowing verification keys to be substituted.

4

What is the available remediation?

Upgrade PyJWT to version 2.14.0, which fixes the redirect handling issue.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203