CVE-2026-32597: PyJWT Accepts Unknown `crit` Header Extensions Leading to Security Bypass

pyjwt Updated 14 Mar 2026

Summary

13/03/2026
Yes i
High
7.5

CVE-2026-32597: PyJWT accepts unknown crit header extensions. Affects pyjwt versions < 2.12.0. Fixed in 2.12.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

PyJWT is a Python library used for encoding and decoding JSON Web Tokens (JWT). It provides a simple way to handle JWTs, allowing developers to securely transmit information between parties. However, PyJWT has a vulnerability that allows it to accept tokens with unknown critical header extensions, which can lead to security policy bypasses.

Vulnerability Detail

The vulnerability arises from PyJWT's failure to validate the crit (Critical) Header Parameter as defined in RFC 7515. When a JWS token contains a crit array with extensions that PyJWT does not recognize, it incorrectly accepts the token instead of rejecting it. This behavior violates the RFC's requirement that any unknown critical extensions must render the JWS invalid. The implications of this vulnerability include potential split-brain verification in mixed-library environments, security policy bypasses, and silent ignoring of critical extensions that enforce security measures such as multi-factor authentication.

How To Fix

Latest published version: 2.15.1 as of 23 Oct 2026

pip install --upgrade "pyjwt==2.15.1"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.12.0

This is the first release that contains the fix.

pip install --upgrade "pyjwt==2.12.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate upgrading is not feasible, consider implementing a manual check for the crit header in your application. Here is an example of how to validate the crit header before decoding the token:

import jwt

def validate_crit(headers):
    crit = headers.get('crit')
    if crit is not None:
        if not isinstance(crit, list) or len(crit) == 0:
            raise jwt.InvalidTokenError('crit must be a non-empty array')
        for ext in crit:
            raise jwt.InvalidTokenError(f'Unsupported critical extension: {ext}')

# Use this function before decoding your token

Conclusion

The vulnerability CVE-2026-32597 in PyJWT allows for the acceptance of tokens with unknown critical extensions, posing significant security risks. It is crucial to update to the patched version and implement additional validation to safeguard against potential exploits.

See every vulnerability recorded for pyjwt →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

The crit header indicates that certain extensions must be understood and processed by the recipient. If any listed extensions are not recognized, the token should be considered invalid.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The impacts include security policy bypasses, split-brain verification in mixed-library deployments, and silent ignoring of critical security measures.

Regularly update your dependencies, monitor for vulnerabilities using tools like Vulert, and implement proper validation for JWT headers.

Related vulnerabilities

Recent vulnerabilities recorded for pyjwt.

How To Fix

Latest published version: 2.15.1 as of 23 Oct 2026

pip install --upgrade "pyjwt==2.15.1"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.12.0

This is the first release that contains the fix.

pip install --upgrade "pyjwt==2.12.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback