CVE-2026-102270

PyJWT: ReDoS vulnerability when calling the `is_pem_format` function.

Published Sep 28, 2026 CVSS 3.1 · 4.4 Medium EPSS < 1% KEV · Not listed
Description
PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, PyJWT is_pem_format is affected because lazy PEM regular expression backtracks extensively. This occurs when a certificate-like input contains repeated BEGIN markers without a matching END marker. As a result, is_pem_format performs unbounded backtracking while searching for a PEM end marker. Consequently, an attacker can cause intensive CPU consumption. This issue is fixed in version 2.14.0.

Analysis

AI-generated

Technical impact

The vulnerability exists in the is_pem_format function of PyJWT. A crafted string containing multiple repeated BEGIN markers without a matching END marker triggers excessive backtracking in a lazy PEM regular expression, causing the function to consume excessive CPU time. This results in a denial-of-service condition that can be exploited by an attacker who can supply such input to the application.

Affected Systems

Affected versions of PyJWT are those prior to 2.14.0, known for the jpadilla:pyjwt package. Systems that rely on this package for JWT validation or certificate parsing are at risk, including any Python web services or applications that import PyJWT directly. The issue is fixed in PyJWT 2.14.0 and later.

Risk and Exploitability

The CVSS score for this vulnerability is 4.4, indicating a moderate severity. No EPSS score is available, and the vulnerability is not present in the CISA KEV list. Attackers must be able to cause the application to call is_pem_format with a malicious string; the actual vector depends on how the application handles JWTs. The impact is primarily resource exhaustion, leading to a denial of service of the affected process.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade PyJWT to version 2.14.0 or later, where the regex has been rewritten to avoid excessive backtracking.
  • If an upgrade is not currently possible, enforce input validation by checking that any PEM-like string contains no more than one BEGIN marker and a matching END marker, and reject malformed strings before calling is_pem_format.
  • Apply resource limiting to Python processes using PyJWT, such as setting CPU limits or running the JWT parsing code in a sandbox, to prevent a single request from exhausting system resources.

Generated by OpenCVE AI on September 28, 2026 at 21:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-jwrc-g2q2-pq5p PyJWT: ReDoS vulnerability when calling the `is_pem_format` function.
History
Type Values Removed Values Added
First Time appeared Pyjwt Project
Pyjwt Project pyjwt
CPEs cpe:2.3:a:pyjwt_project:pyjwt:*:*:*:*:*:*:*:*
Vendors & Products Pyjwt Project
Pyjwt Project pyjwt
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Jpadilla
Jpadilla pyjwt
Vendors & Products Jpadilla
Jpadilla pyjwt
Type Values Removed Values Added
Description PyJWT is a Python implementation of JSON Web Token standards. Prior to 2.14.0, PyJWT is_pem_format is affected because lazy PEM regular expression backtracks extensively. This occurs when a certificate-like input contains repeated BEGIN markers without a matching END marker. As a result, is_pem_format performs unbounded backtracking while searching for a PEM end marker. Consequently, an attacker can cause intensive CPU consumption. This issue is fixed in version 2.14.0.
Title PyJWT: ReDoS vulnerability when calling the `is_pem_format` function.
Weaknesses CWE-1333
References
Metrics cvssV3_1

{'score': 4.4, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H'}

Weaknesses
  • CWE-1333

    Inefficient Regular Expression Complexity

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 29, 2026, 7:36 PM
Reserved
Sep 28, 2026, 8:11 PM
Status
Analyzed
Published
Sep 28, 2026, 9:17 PM
Modified
Oct 6, 2026, 6:46 PM
Severity
Moderate
Public date
Sep 28, 2026, 8:29 PM