VDB
Sign up
MEDIUM5.4

PYSEC-2026-176

Quick fix

PYSEC-2026-176 — pyjwt: upgrade to the fixed version with the command below.

pip install --upgrade 'pyjwt>=2.12.1'

Details

PyJWT is a JSON Web Token implementation in Python. From 2.9.0 to 2.12.1, there is a verifier-side algorithm allow-list bypass when jwt.decode() or jwt.decode_complete() are called with a PyJWK key. The token header alg is checked against the caller-supplied algorithms allow-list, but signature verification is performed with the algorithm bound to the PyJWK object instead of the header algorithm. An attacker who controls a registered JWK/JWKS private key can sign with a disallowed algorithm, advertise an allowed algorithm in the JWT header, and still be accepted. The issue affects the documented PyJWKClient.get_signing_key_from_jwt(...) flow. This vulnerability is fixed in 2.13.0.

Are you affected?

Enter the version of the package you're using.

Affected packages

PyPI/pyjwt
Introduced in: 2.9.0Fixed in: 2.12.1
Fixpip install --upgrade 'pyjwt>=2.12.1'

References