CVE-2026-48522: PyJWKClient: missing scheme allowlist enables CVE-2024-21643-class SSRF + token forgery via file://, ftp://, data: schemes
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) — the file’s contents are passed tojson.load. - Cause PyJWKClient to attempt FTP / data-URI fetches (broader SSRF surface).
- Forge tokens that PyJWT verifies as valid — if the attacker can write to any path the JKU URL points at AND influences the URL, they can plant a JWK Set containing their own public key, sign tokens with the matching private key, and
jwt.decode()accepts.
References
Code Behaviors & Features
Detect and mitigate CVE-2026-48522 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →