Skip to content

← Actionable
Medium, CVSS 4.4amended

PyJWT: ReDoS vulnerability when calling the is_pem_format function.

CVE-2026-102270GHSA-jwrc-g2q2-pq5p

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (pyjwt 2.14.0), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • PyPI pyjwt

    Affected
    <= 2.13.0
    Fixed in
    2.14.0

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
4.4 · CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
EPSS
  • CVE-2026-102270: 0.25% estimated exploitation activity in the next 30 days; percentile 15.89 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Summary There is a Re-DoS vulnerability in the ispemformat function which results in a intesive CPU usage if an attacker is been able to provide a custom certificate. Details The problem is that the lazy quantifier .+? will always first try to match as little as possible until it finds a ---- END. Normally this means the complexity of this should be O(N). However, by providing an input which consists only of ----BEGIN CERTIFICATE----- lines and no ---- END line, the regex algorithm will first try to match the first line and then, with the lazy quantifier, all the lines until the end O(N), which then fails since it is unable to find a ---- END line. It will then jump to the next line, resulting in N re-scans of the whole string, which means the complexity basically results in O(N²). PoC Impact The attacker could use extensive resources, which could make the resource (e.g. a web server) unavailable. Maintainer update (2026-09-10): We reproduced the reported quadratic regex behavior on…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 3 · amended ·

    Amended from ghsa record GHSA-jwrc-g2q2-pq5p

  2. Revision 2 · amended ·

    Amended from osv record GHSA-jwrc-g2q2-pq5p

  3. Revision 1 · created ·

    Published from ghsa record GHSA-jwrc-g2q2-pq5p

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-102270

Advisory: PyJWT: ReDoS vulnerability when calling the `is_pem_format` function.
IDs: CVE-2026-102270, GHSA-jwrc-g2q2-pq5p
Record: https://patchnext.com/advisories/cve-2026-102270 (revision 3, source checked 26 Oct 2026, 13:54 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 4.4)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: pyjwt 2.14.0. A vendor fix does not mean a deployment is fixed.

## Affected components
- PyPI pyjwt: affected <= 2.13.0; fixed in 2.14.0

## Suggested inspection (read-only)
- `python -m pip show pyjwt`: prints the installed version. Run with the environment that serves production active.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on pyjwt.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://github.com/advisories/GHSA-jwrc-g2q2-pq5p (GitHub-reviewed advisory GHSA-jwrc-g2q2-pq5p lists affected ranges: PyPI pyjwt >=0 <=2.13.0)
- Verified: https://osv.dev/vulnerability/GHSA-jwrc-g2q2-pq5p (OSV record GHSA-jwrc-g2q2-pq5p lists affected ranges: PyPI pyjwt >=0 <2.14.0 (fixed))

Commands are suggestions: review each one before running it.

Loading voting…