CVE-2026-48522·Python vulnerability
PyJWT is a JSON Web Token implementation in Python. Prior to 2.13.0, PyJWKClient passes its uri argument directly to urllib.request.urlopen() which uses Python stdlib's default OpenerDirector registering HTTPHandler, HTTPSHandler, FTPHandler, FileHandler, and DataHandler. There is currently no documented option to restrict which schemes PyJWKClient will fetch. If an application's jku URL ingestion path accepts attacker-influenced URLs (e.g., from JWT header, configuration file, OAuth flow parameter), the attacker can cause PyJWKClient to read arbitrary local files via file:// (SSRF on local filesystem), cause PyJWKClient to attempt FTP / data-URI fetches (broader SSRF surface), or forge tokens that PyJWT verifies as valid. The library does not directly return non-HTTP(S) URI contents to the attacker; the chained "plant a JWKS to forge tokens" scenario described in the original report requires additional application-layer flaws (attacker write access to a filesystem path, untrusted jku derivation) that this fix does not address. This vulnerability is fixed in 2.13.0.
- Severity
- medium
- Software
- Python
- Fixed in
- 2.13.0
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.22% — higher than 13% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
Until: 2.13.0
Fixed in: 2.13.0
How to fix this CVE
Update PyJWT to version 2.13.0 or later to restrict URI scheme handling in PyJWKClient. This fix prevents attackers from exploiting applications that pass untrusted URLs to the JWT key client, blocking file:// and ftp:// scheme attacks. Review your application's JWT configuration to ensure the jku (JWK Set URL) parameter comes only from trusted sources.
sudo dnf check-update python3-jwt && sudo dnf update python3-jwtDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check installed PyJWT version: python3 -c "import jwt; print(jwt.__version__)"
- Step 2: Verify if your application accepts dynamic jku URLs: grep -r "jku" /path/to/app/config/ /path/to/app/code/
- Step 3: Search application logs for file:// or ftp:// scheme access attempts in JWT processing: grep -i "file://\|ftp://" /var/log/application.log
- Step 4: Confirm the fix with: python3 -c "import jwt; print(jwt.__version__)" and verify version >= 2.13.0
FAQ
What is CVE-2026-48522?
This vulnerability in PyJWT allows attackers to exploit applications that accept user-controlled URLs for JWKS (JSON Web Key Set) retrieval. By injecting file:// or ftp:// URIs, attackers can trigger local file access or broader server-side request forgery attacks, potentially enabling token forgery if combined with other application flaws.
Is CVE-2026-48522 being actively exploited?
No, this vulnerability is not listed in CISA's Known Exploited Vulnerabilities catalog and no public exploits are currently available. However, the attack surface is significant for applications that accept dynamic jku parameters from untrusted sources.
What versions of Python are affected by CVE-2026-48522?
All versions of PyJWT prior to 2.13.0 are affected. The vulnerability exists in the PyJWKClient class which handles key fetching for JWT verification.
How do I check if my server is vulnerable to CVE-2026-48522?
Run: python3 -c "import jwt; print(jwt.__version__)" If the version is below 2.13.0, your installation is vulnerable. Additionally, check if your application passes any external or user-supplied URLs to PyJWKClient.
Does Defensia detect CVE-2026-48522?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If PyJWT is installed on a monitored server, CVE-2026-48522 will appear in your dashboard with remediation steps.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-48522. Free for 1 server.
Get started free