CVE-2026-101917: PyJWT: PyJWKClient still amplifies unauthenticated JWKS fetches on unknown kid values (incomplete fix of CVE-2026-48524)

Published Sep 28, 2026
·
Updated

PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, PyJWT getsigningkeyfromjwt is affected because unknown kid misses force refreshes without a negative cache or minimum refresh interval. This occurs when unauthenticated tokens repeatedly use the same unknown kid or varying kid values absent from the cached JWKS. As a result, each cache miss causes PyJWKClient to refresh the JWKS. Consequently, attacker traffic can amplify outbound requests to the configured JWKS endpoint. This issue is fixed in version 2.14.0.

Other sources

PyJWT: PyJWKClient still amplifies unauthenticated JWKS fetches on unknown kid values (incomplete fix of CVE-2026-48524)

— Microsoft

Summary CVE-2026-48524 (GHSA-fhv5-28vv-h8m8, "PyJWKClient unbounded JWKS endpoint requests via attacker-controlled kid values (DoS)") was fixed in 2.13.0 by stopping fetchdata() from clearing the cache on a fetch error. That closed one amplification path but did not add the mitigation the advisory's title implies: there is still no rate-limit, negative-cache, or minimum-refresh-interval for unknown kids.

At HEAD, getsigningkey(kid) (jwt/jwksclient.py:185-211), on any unknown kid, calls getsigningkeys(refresh=True), and refresh=True bypasses jwksetcache unconditionally and forces a fresh fetchdata(). The kid is read from the unverified token header (getsigningkeyfromjwt decodes with verifysignature=False), so no valid token and no authentication is required. lrucache does not cache the raised exception, so even the same unknown kid repeated re-fetches on every call.

Affected pyjwt <= 2.13.0 (the latest release; the patched release for CVE-2026-48524). No fixed version yet.

Proof of concept (verified on 2.13.0, cache enabled = realistic prod config) import threading, http.server, socketserver, json from jwt import PyJWKClient hits = {'n': 0} JWKS = json.dumps({"keys":[{"kty":"oct","kid":"real","k":"AAAA"}]}).encode() class H(http.server.BaseHTTPRequestHandler): def doGET(self): hits['n'] += 1 self.sendresponse(200); self.sendheader('Content-Type','application/json'); self.endheaders() self.wfile.write(JWKS) def logmessage(self,a): pass srv = socketserver.TCPServer(('127.0.0.1',0), H); port = srv.serveraddress[1] threading.Thread(target=srv.serveforever, daemon=True).start() c = PyJWKClient(f'http://127.0.0.1/:{port}/jwks.json', cachekeys=True, lifespan=3600) for i in range(8): try: c.getsigningkey(f'attacker-unknown-kid-{i}') except Exception: pass before = hits['n'] for in range(5): try: c.getsigningkey('same-unknown') except Exception: pass print('distinct unknown kids: 8 -> fetches:', hits['n']) print('same unknown kid x5 -> extra fetches:', hits['n'] - before)

Output: distinct unknown kids: 8 -> fetches: 9 same unknown kid x5 -> extra fetches: 5 Each unknown kid forces a fresh JWKS fetch; a repeated identical unknown kid still re-fetches every time against an unexpired cache. No rate-limit or negative-cache.

Impact One unauthenticated request -> one outbound JWKS HTTP fetch + full JSON parse on the victim server. An attacker floods tokens carrying junk kids, so the victim hammers its own JWKS/IdP endpoint (amplification: attacker -> victim -> IdP), exhausting victim CPU/sockets and potentially tripping the JWKS provider's rate-limit, causing an application-wide auth outage. This is the unauthenticated DoS the parent advisory is named for, still reachable after the 2.13.0 fix.

Suggested fix Guard the forced refresh on unknown kids: negative-cache unknown kids for a short TTL, or enforce a minimum interval between forced JWKS refreshes, so a repeated or unknown kid cannot force unbounded fetches.

Note: the same-kid-repeated result (5 identical unknown kids producing 5 fetches against an unexpired cache) shows this is request amplification, not legitimate key-rotation handling, since that refresh can never succeed.

Reported by Babakizo (Securva).

Maintainer update — 2026-09-10

The maintainer confirmed the reported behavior against PyJWT 2.13.0. With JWKS caching enabled, an unknown kid previously forced an unconditional JWKS refresh, including when the same unknown value was repeated while the cached key set was still valid. This allowed unauthenticated token headers to cause unnecessary outbound JWKS requests and repeated parsing work.

The fix is now on master in commit ba4853a. PyJWKClient now applies a 30-second cooldown after successful JWKS fetches before permitting another unknown-kid refresh, serializes concurrent refresh decisions per client, and allows callers to configure or disable the cooldown. Cache-disabled behavior and immediate retry after failed fetches remain unchanged.

Regression tests cover repeated unknown kids, cooldown expiry, concurrent misses, cache-disabled operation, and invalid cooldown values. The available full tox matrix, Ruff, and mypy checks pass. The fix will be included in the next released 2.x version.

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.

— GitHub

Affected Software

4 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

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

    Fixed in 2.14.0

Event History

Sep 28, 2026
CVE Published
via MITRE·08:07 PM
Data Sourced
via MITRE·08:07 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:17 PM
RemedyAffected Software
Sep 29, 2026
Advisory Published
via GitHub·11:11 PM
Data Sourced
via GitHub·11:11 PM
DescriptionSeverityWeaknessAffected Software
Sep 30, 2026
Data Sourced
via Microsoft·08:03 AM
DescriptionSeverityWeaknessAffected Software
Updated
via Microsoft·08:03 AM
DescriptionSeverity
Jun 17, 58737
Event
via NVD·02:35 AM

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments using PyJWT versions before 2.14.0 and calling PyJWKClient.get_signing_key_from_jwt with a configured JWKS endpoint are exposed. The condition is triggered when tokens contain a kid that is absent from the cached JWKS.

2

What does an attacker need to do to trigger the behavior?

An attacker only needs to send unauthenticated tokens with an unknown kid value. Repeated use of one unknown kid or use of varying unknown kid values can cause a JWKS refresh for each cache miss.

3

What is the practical impact?

Attacker traffic can amplify outbound requests from the application to its configured JWKS endpoint. The reported impact is availability degradation rather than loss of confidentiality or integrity.

4

What should be done if upgrading is not immediately possible?

The provided data identifies 2.14.0 as the fix but does not specify a workaround. Until upgrading, treat endpoints that process untrusted JWTs through PyJWKClient as susceptible to outbound JWKS request amplification.

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