GHSA-9v7f-9g4p-ffgj: Infoleak

Published Sep 29, 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.

Affected Software

1 affected componentFixes available
pip/PyJWT<=2.13.0
2.14.0

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 PyJWT to a version that resolves this vulnerability.

    Fixed in 2.14.0

Event History

Sep 29, 2026
Advisory Published
via GitHub·11:15 PM
Data Sourced
via GitHub·11:15 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which deployments are realistically exposed?

Deployments using PyJWT 2.13.0 or earlier and PyJWKClient to retrieve JWKS are affected. Exploitation additionally depends on the application supplying request headers and an attacker being able to influence a redirect response from the configured trusted JWKS endpoint.

2

Can an attacker trigger this solely by choosing a JWT kid value?

No. The issue requires an attacker-influenced redirect from the configured JWKS endpoint; a token kid value alone does not trigger it.

3

What could an attacker gain from a successful redirect?

The redirected request could disclose caller-supplied headers to the redirect destination. The destination's JWKS response could also be treated as authoritative key material, enabling JWKS trust poisoning and, in affected mixed-configuration applications, acceptance of forged JWTs.

4

What mitigation is available if an upgrade is not immediately possible?

Avoid configurations where PyJWKClient sends caller-supplied request headers and ensure the configured JWKS endpoint cannot be induced to return attacker-controlled redirects. The upstream fix disables automatic redirects for JWKS fetches.

5

How can I determine whether a deployment is affected?

Check whether the application uses PyJWKClient with PyJWT 2.13.0 or earlier, and inspect its JWKS fetch configuration for caller-supplied headers. Also determine whether the configured JWKS endpoint can return redirects influenced by an attacker.

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