# CVE-2026-48522: PyJWT SSRF and token forgery in PyJWKClient via URI schemes

Source: https://junglewise.ai/threats/cve-2026-48522-pyjwt-ssrf-and-token-forgery-in-pyjwkclient-via-uri-schemes  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-05-28. Updated: 2026-06-15  
License: CC BY 4.0 with a link back

CVE-2026-48522 · Severity: medium · CVSS 4.2 · Published 2026-05-28

A vulnerability in the PyJWT library allows attackers to trick the system into reading local files or connecting to unintended internal services. This occurs when the library processes security keys from a web address provided in a token without checking if that address is a standard website. In specific configurations, an attacker could use this to bypass security checks and forge valid-looking login tokens.

Technologies: [Jpadilla PyJWT](https://junglewise.ai/threats/technologies/pyjwt), [pyjwt (PyPI)](https://junglewise.ai/threats/technologies/pypi-pyjwt). Vendors: [Jpadilla](https://junglewise.ai/threats/vendors/jpadilla), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-48522 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-48522 being exploited in the wild.

**How severe is CVE-2026-48522?** Medium severity, with a CVSS score of 4.2, published 28 May 2026.

**Which products and versions are affected?** Jpadilla PyJWT < 2.13.0, <= 2.12.1; pyjwt (PyPI) ECOSYSTEM:introduced=0,fixed=2.13.0, ECOSYSTEM:introduced=2.0.0,fixed=2.13.0.

**Is there a fix for CVE-2026-48522?** Yes. pyjwt (PyPI): upgrade to 2.13.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-48522 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-48522?** Check whether you run Jpadilla PyJWT or pyjwt (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- pyjwt (PyPI): upgrade to 2.13.0 or later

  ```sh
  pip install "pyjwt>=2.13.0"
  ```


## Technical details

The PyJWKClient class in PyJWT passes the 'uri' argument directly to Python's urllib.request.urlopen() without validating the protocol scheme. By default, this allows the use of FileHandler, FTPHandler, and DataHandler. An attacker who can influence the 'jku' (JWK Set URL) parameter in a JWT header can trigger an SSRF to read local files or interact with internal network services. If the attacker also has write access to a location reachable via these schemes, they can provide a malicious JWK set to forge tokens that the library will verify as authentic. The fix introduces an 'allowed_schemes' parameter defaulting to ('https', 'http').

## Affected products

- jpadilla PyJWT <= 2.12.1

## Identifiers

- CVE-2026-48522
- GHSA-993g-76c3-p5m4
- PYSEC-2026-175

## Timeline

- 2026-05-06: other: Vulnerability verified by researcher
- 2026-05-21: disclosed: Advisory published on GitHub
- 2026-06-15: advisory: Advisory updated with CVE-2026-48522

## References

- [https://api.github.com/users/KEIJOT](https://api.github.com/users/KEIJOT)
- [https://github.com/KEIJOT](https://github.com/KEIJOT)
- [https://api.github.com/users/KEIJOT/gists%7B/gist_id%7D](https://api.github.com/users/KEIJOT/gists%7B/gist_id%7D)
- [https://api.github.com/users/KEIJOT/repos](https://api.github.com/users/KEIJOT/repos)
- [https://avatars.githubusercontent.com/u/33745051?v=4](https://avatars.githubusercontent.com/u/33745051?v=4)
- [https://api.github.com/users/KEIJOT/events%7B/privacy%7D](https://api.github.com/users/KEIJOT/events%7B/privacy%7D)

## Related threats

- [PyJWT HS256/384/512 token forgery via empty HMAC key in oct JWK](https://junglewise.ai/threats/pyjwt-hs256-384-512-verify-accepts-empty-hmac-key-via-oct-jwk-pyjwk-a3ba63d2)
- [PyJWT decode() options-dict mutation enabling claim-verification bypass](https://junglewise.ai/threats/cve-2026-103001-pyjwt-decode-reintroduces-options-dict-mutation-enabling-silent)
- [PyJWT OKP algorithm key validation bypass](https://junglewise.ai/threats/cve-2026-102275-pyjwt-is-a-python-implementation-of-json-web-token-standards)
- [PyJWT unhandled ValueError in JWK Set parsing](https://junglewise.ai/threats/cve-2026-102274-pyjwt-is-a-python-implementation-of-json-web-token-standards)
- [PyJWT HMAC key validation bypass in HMACAlgorithm.prepare_key](https://junglewise.ai/threats/cve-2026-102273-pyjwt-is-a-python-implementation-of-json-web-token-standards)
