CVE-2026-48524: CWE-460: Improper Cleanup on Thrown Exception in jpadilla pyjwt
> [!NOTE] > The vulnerability surfaces only when a JWKS fetch fails; an attacker can attempt to provoke that with sustained unknown-kid traffic, but the outcome depends on upstream JWKS-endpoint behavior (rate limiting, transient errors) which is beyond the attacker's control. Impact is reduced auth availability until the next successful fetch, not complete denial of service. ## Summary PyJWKClient.get_signing_key() forces a fresh HTTP request to the JWKS endpoint for every JWT with an unknown kid value, with no rate limiting. Since kid comes from the unverified token header, an attacker can trigger unlimited outbound requests. Additionally, fetch_data() finally block clears the JWKS cache on network error. ## Root Cause jwt/jwks_client.py:172-198 - get_signing_key(kid) calls get_signing_keys(refresh=True) for unknown kids, bypassing TTL cache with no cooldown. jwt/jwks_client.py:120-122 - finally block writes None to cache on error, clearing valid data. ## Impact - DoS against JWKS endpoint (unlimited requests per invalid token) - DoS against application (network I/O latency) - Cascading failure (rate limiting clears cache, breaking legitimate auth) ## Suggested Fix 1. Add refresh cooldown (refuse refresh more than once per TTL period) 2. Move cache write from finally to else block ## Affected Versions All versions with PyJWKClient (2.4.0 through 2.12.1)
AI Analysis
Technical Summary
The vulnerability in pyjwt's PyJWKClient.get_signing_key() method forces an HTTP request to the JWKS endpoint for every JWT token with an unknown kid header value, bypassing any caching and without rate limiting. Since the kid value is unverified, an attacker can trigger unlimited outbound requests. Additionally, on network errors, the JWKS cache is cleared due to a finally block writing None to the cache, which can cause cascading failures by breaking legitimate authentication. The root cause is the lack of a refresh cooldown and improper cache clearing logic. This affects all pyjwt versions with PyJWKClient from 2.4.0 up to but not including 2.13.0.
Potential Impact
The vulnerability can be exploited to cause denial of service against the JWKS endpoint by triggering unlimited requests with invalid kid values. It can also degrade application availability due to network I/O latency and cause cascading failures by clearing the JWKS cache on network errors, which breaks legitimate authentication until the next successful fetch. The impact is limited to reduced authentication availability rather than complete denial of service.
Mitigation Recommendations
A patch is available that addresses this issue by adding a refresh cooldown to prevent frequent JWKS refreshes within the TTL period and by moving the cache write operation from a finally block to an else block to avoid clearing valid cache data on errors. Users should upgrade to pyjwt version 2.13.0 or later to remediate this vulnerability.
CVE-2026-48524: CWE-460: Improper Cleanup on Thrown Exception in jpadilla pyjwt
Description
> [!NOTE] > The vulnerability surfaces only when a JWKS fetch fails; an attacker can attempt to provoke that with sustained unknown-kid traffic, but the outcome depends on upstream JWKS-endpoint behavior (rate limiting, transient errors) which is beyond the attacker's control. Impact is reduced auth availability until the next successful fetch, not complete denial of service. ## Summary PyJWKClient.get_signing_key() forces a fresh HTTP request to the JWKS endpoint for every JWT with an unknown kid value, with no rate limiting. Since kid comes from the unverified token header, an attacker can trigger unlimited outbound requests. Additionally, fetch_data() finally block clears the JWKS cache on network error. ## Root Cause jwt/jwks_client.py:172-198 - get_signing_key(kid) calls get_signing_keys(refresh=True) for unknown kids, bypassing TTL cache with no cooldown. jwt/jwks_client.py:120-122 - finally block writes None to cache on error, clearing valid data. ## Impact - DoS against JWKS endpoint (unlimited requests per invalid token) - DoS against application (network I/O latency) - Cascading failure (rate limiting clears cache, breaking legitimate auth) ## Suggested Fix 1. Add refresh cooldown (refuse refresh more than once per TTL period) 2. Move cache write from finally to else block ## Affected Versions All versions with PyJWKClient (2.4.0 through 2.12.1)
CVSS v3.1
Score 3.7low
Affected software
jpadilla
pyjwt
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in pyjwt's PyJWKClient.get_signing_key() method forces an HTTP request to the JWKS endpoint for every JWT token with an unknown kid header value, bypassing any caching and without rate limiting. Since the kid value is unverified, an attacker can trigger unlimited outbound requests. Additionally, on network errors, the JWKS cache is cleared due to a finally block writing None to the cache, which can cause cascading failures by breaking legitimate authentication. The root cause is the lack of a refresh cooldown and improper cache clearing logic. This affects all pyjwt versions with PyJWKClient from 2.4.0 up to but not including 2.13.0.
Potential Impact
The vulnerability can be exploited to cause denial of service against the JWKS endpoint by triggering unlimited requests with invalid kid values. It can also degrade application availability due to network I/O latency and cause cascading failures by clearing the JWKS cache on network errors, which breaks legitimate authentication until the next successful fetch. The impact is limited to reduced authentication availability rather than complete denial of service.
Mitigation Recommendations
A patch is available that addresses this issue by adding a refresh cooldown to prevent frequent JWKS refreshes within the TTL period and by moving the cache write operation from a finally block to an else block to avoid clearing valid cache data on errors. Users should upgrade to pyjwt version 2.13.0 or later to remediate this vulnerability.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-21T16:18:10.619Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6a186056e29bf47b500b42d8
Added to database: 05/28/2026, 15:33:42 UTC
Last enriched: 08/01/2026, 21:28:52 UTC
Last updated: 09/14/2026, 23:50:04 UTC
Views: 116
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.