CVE-2026-32597·Python vulnerability
PyJWT is a JSON Web Token implementation in Python. Prior to 2.12.0, PyJWT does not validate the crit (Critical) Header Parameter defined in RFC 7515 §4.1.11. When a JWS token contains a crit array listing extensions that PyJWT does not understand, the library accepts the token instead of rejecting it. This violates the MUST requirement in the RFC. This vulnerability is fixed in 2.12.0.
- Severity
- high
- Software
- Python
- Fixed in
- 2.12.0
- Published
- 2026-03-13
Affected versions
Until: 2.12.0
Fixed in: 2.12.0
How to fix this CVE
Upgrade PyJWT to version 2.12.0 or later to properly validate the Critical (crit) header parameter in JWT tokens. This fix ensures that tokens with unrecognized critical extensions are rejected rather than silently accepted, complying with RFC 7515 standards. Applications using older versions should prioritize this update to prevent acceptance of malformed or malicious JWT tokens.
sudo dnf update python3-jwtDefensia detects this vulnerability
How to check if you are affected
- Check installed PyJWT version: python3 -c "import jwt; print(jwt.__version__)"
- List all JWT-dependent packages: pip list | grep -i jwt or python3 -m pip list | grep -i jwt
- Verify if applications import jwt: grep -r "import jwt" /opt /srv /home --include="*.py" 2>/dev/null
- After patching, re-run the version check to confirm upgrade to 2.12.0 or later
FAQ
What is CVE-2026-32597?
This vulnerability affects PyJWT's handling of JWT token headers. The library fails to validate the critical extensions parameter (crit) as required by RFC 7515, allowing it to accept tokens with unrecognized critical claims instead of rejecting them. This could allow attackers to craft tokens with extension fields that applications do not properly handle.
Is CVE-2026-32597 being actively exploited?
No, this vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits have been disclosed. However, the RFC compliance violation makes it a medium-term security concern for applications relying on strict JWT validation.
What versions of Python are affected by CVE-2026-32597?
All versions of PyJWT prior to 2.12.0 are affected. The vulnerability exists regardless of the Python interpreter version, but impacts any application using the vulnerable PyJWT library for JWT processing.
How do I check if my server is vulnerable to CVE-2026-32597?
Run: python3 -c "import jwt; print(jwt.__version__)" and compare against 2.12.0. If the version is below 2.12.0, your server is vulnerable. You can also check: python3 -c "import jwt; print('Vulnerable' if tuple(map(int, jwt.__version__.split('.'))) < (2, 12, 0) else 'Patched')"
Does Defensia detect CVE-2026-32597?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If PyJWT is installed on a monitored server, CVE-2026-32597 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-32597. Free for 1 server.
Get started free