CVE-2026-102266: PyJWT Vulnerability Allows Bypass of HMAC Key Validation

pyjwt Updated 30 Sep 2026

Summary

29/09/2026
Yes i
High
7.4

CVE-2026-102266: PyJWT: PyJWK accepts empty HMAC keys, bypassing PyJWT's empty-key validation. Affects pyjwt versions >= 2.13.0, < 2.14.0. Fixed in 2.14.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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

PyJWT is a Python library used for encoding and decoding JSON Web Tokens (JWTs). It supports various algorithms for signing tokens, including HMAC. The library is widely used in applications for secure token-based authentication. However, a vulnerability exists in version 2.13.0 that allows the acceptance of empty HMAC keys when using PyJWK, compromising the integrity of token verification.

Vulnerability Detail

The vulnerability arises from inconsistent validation of HMAC keys in PyJWT. When an empty oct JWK is supplied through PyJWK, it bypasses the empty-key validation that would normally reject such keys. This allows attackers to generate valid HS256 JWTs with arbitrary claims, leading to potential authentication bypass, user impersonation, and unauthorized access to protected resources. The issue is particularly concerning as it does not require control over the JWK source or any additional credentials.

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.14.0

This is the first release that contains the fix.

pip install --upgrade "pyjwt==2.14.0"

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

Workaround

As a temporary workaround, ensure that your application does not use empty HMAC keys in your JWK configuration. Additionally, you can enable minimum key length enforcement by setting enforce_minimum_key_length=True in your JWT decoding options.

Conclusion

The vulnerability CVE-2026-102266 in PyJWT allows for the acceptance of empty HMAC keys through PyJWK, leading to serious security risks. It is crucial to update to the patched version 2.14.0 to mitigate these risks and ensure the integrity of your token-based authentication system.

See every vulnerability recorded for pyjwt →

Share this vulnerability

FAQ

The vulnerability allows attackers to create valid JWTs with arbitrary claims, potentially leading to authentication bypass and unauthorized access.

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

PyJWT versions 2.13.0 are affected. The vulnerability is fixed in version 2.14.0.

If you cannot update immediately, ensure that you do not use empty HMAC keys in your JWK configuration and enable minimum key length enforcement.

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

Related vulnerabilities

Recent vulnerabilities recorded for pyjwt.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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.14.0

This is the first release that contains the fix.

pip install --upgrade "pyjwt==2.14.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