---
id: CVE-2026-102271
title: PyJWT is a Python implementation of JSON Web Token standards
summary: >-
  PyJWT is a Python implementation of JSON Web Token standards. From 2.4.0 until
  2.14.0, PyJWT HMACAlgorithm.prepare_key is affected because asymmetric-key
  guard relies on textual markers that are absent from DER encoding. This occurs
  when…
severity: high
cvss: 7.4
cvssVector: 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N'
cwe:
  - CWE-347
vendor: pyjwt_project
product: pyjwt
affected:
  - 'pyjwt >= 2.4.0, < 2.14.0'
patched:
  - pyjwt 2.14.0
published: '2026-09-28'
updated: '2026-10-06'
sourceUpdated: '2026-10-06T18:36:16.047'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-102271'
references:
  - url: >-
      https://github.com/jpadilla/pyjwt/commit/2798504fa2663364573cf2d1043d8d7fef389499
    label: security-advisories@github.com
  - url: 'https://github.com/jpadilla/pyjwt/releases/tag/2.14.0'
    label: security-advisories@github.com
  - url: 'https://github.com/jpadilla/pyjwt/security/advisories/GHSA-p4g4-x82p-q773'
    label: security-advisories@github.com
  - url: 'https://github.com/jpadilla/pyjwt/security/advisories/GHSA-p4g4-x82p-q773'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-102271.json
  - url: 'https://access.redhat.com/security/cve/CVE-2026-102271'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2542687'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2026-102271'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-102271'
  - url: 'https://github.com/advisories/GHSA-p4g4-x82p-q773'
  - url: 'https://github.com/jpadilla/pyjwt'
  - url: 'https://pypi.org/project/pyjwt'
  - url: 'https://access.redhat.com/errata/RHSA-2026:82415'
  - url: 'https://access.redhat.com/errata/RHSA-2026:82368'
  - url: 'https://access.redhat.com/errata/RHSA-2026:82061'
  - url: 'https://access.redhat.com/errata/RHSA-2026:82059'
  - url: 'https://access.redhat.com/errata/RHSA-2026:82371'
  - url: 'https://access.redhat.com/errata/RHSA-2026:87004'
  - url: 'https://access.redhat.com/errata/RHSA-2026:87120'
  - url: 'https://access.redhat.com/errata/RHSA-2026:87124'
tags:
  - nvd
  - cve.org
  - exploit-available
  - csaf
  - vex
  - red-hat
  - ghsa
  - pip
  - osv
epss: 0.00215
epssPercentile: 0.11976
aliases:
  - GHSA-p4g4-x82p-q773
  - PYSEC-2026-4149
ecosystem: pip
exploitAvailable: true
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: total
  timestamp: '2026-10-01T14:57:03.181101Z'
ingestedAt: '2026-09-28T21:20:54.781Z'
---

## Overview

PyJWT is a Python implementation of JSON Web Token standards. From 2.4.0 until 2.14.0, PyJWT HMACAlgorithm.prepare_key is affected because asymmetric-key guard relies on textual markers that are absent from DER encoding. This occurs when an application mixes HMAC and asymmetric algorithms and supplies a DER public key as the shared verification key. As a result, PyJWT uses public DER bytes as an HMAC secret. Consequently, an attacker who knows the public key can forge authenticated HMAC tokens. This issue is fixed in version 2.14.0.

## Affected

- `pyjwt >= 2.4.0, < 2.14.0`

## Remediation

Upgrade past the affected range:

- `pyjwt 2.14.0`

## Package advisory (CVE-2026-102271)

Affected packages:

- `pyjwt >= 2.4.0, < 2.14.0`

Patched in:

- `pyjwt 2.14.0`

Source: https://github.com/advisories/GHSA-p4g4-x82p-q773

## Vendor advisories

- **Red Hat VEX** · Important · affected: Ansible Automation Orchestrator 2026, Lightspeed Core, Red Hat AI Inference Server, Red Hat Ansible Automation Platform 2, Red Hat Enterprise Linux 10, Red Hat Enterprise Linux 9, … · no fix planned: Ansible Automation Orchestrator 2026, Lightspeed Core, Red Hat AI Inference Server, Red Hat Ansible Automation Platform 2, … · updated 2026-10-23 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-102271.json)
- **RHSA-2026:82415** · Red Hat · fixed in: Red Hat AI Inference Server 3.5 · released 2026-10-13 · [advisory](https://access.redhat.com/errata/RHSA-2026:82415)
- **RHSA-2026:82368** · Red Hat · fixed in: Red Hat AI Inference Server 3.5 · released 2026-10-13 · [advisory](https://access.redhat.com/errata/RHSA-2026:82368)
- **RHSA-2026:82061** · Red Hat · fixed in: Red Hat AI Inference Server 3.5 · released 2026-10-13 · [advisory](https://access.redhat.com/errata/RHSA-2026:82061)
- **RHSA-2026:82059** · Red Hat · fixed in: Red Hat AI Inference Server 3.5 · released 2026-10-13 · [advisory](https://access.redhat.com/errata/RHSA-2026:82059)
- **RHSA-2026:82371** · Red Hat · fixed in: Red Hat AI Inference Server 3.5 · released 2026-10-13 · [advisory](https://access.redhat.com/errata/RHSA-2026:82371)
- **RHSA-2026:87004** · Red Hat · fixed in: Red Hat Ansible Automation Platform 2.6 for RHEL 9 · released 2026-10-21 · [advisory](https://access.redhat.com/errata/RHSA-2026:87004)
- **RHSA-2026:87120** · Red Hat · fixed in: Red Hat Ansible Automation Platform 2.6 · released 2026-10-21 · [advisory](https://access.redhat.com/errata/RHSA-2026:87120)
- **RHSA-2026:87124** · Red Hat · fixed in: Red Hat Ansible Automation Platform 2.7 · released 2026-10-21 · [advisory](https://access.redhat.com/errata/RHSA-2026:87124)
