Executive brief
PyJWT is a popular library used to handle JSON Web Tokens (JWTs) for authentication and data exchange. A vulnerability in certain versions allows an attacker who already has a valid signing key to bypass security restrictions on which cryptographic algorithms are allowed. This could allow an attacker to use weaker or deprecated security methods that the system was configured to reject, potentially undermining the integrity of the authentication process.
Technical details
A vulnerability in PyJWT's `_verify_signature()` logic in `jwt/api_jws.py` causes an algorithm allow-list bypass when `PyJWK` objects are used for verification. While the library checks the JWT header's `alg` field against the user-provided `algorithms` allow-list, it performs the actual signature verification using the algorithm bound to the `PyJWK` object itself rather than the one specified in the header. An attacker who controls a registered JWK/JWKS private key can sign a token with a disallowed algorithm (e.g., RS256) but set the header to an allowed one (e.g., PS256), and the token will be accepted. This issue affects the documented `PyJWKClient.get_signing_key_from_jwt()` flow and was introduced in version 2.9.0. It is fixed in version 2.13.0.
Affected products
- jpadilla PyJWT >= 2.9.0, < 2.13.0
Timeline
- 2026-05-21: advisory: GitHub Advisory published
- 2026-06-15: disclosed: CVE-2026-48523 published
- patched: Fixed in version 2.13.0