---
schema_version: '1.0'
id: security-20260930-253a98
title: 'CVE-2026-102269: PyJWT: Non-canonical signature segments enable raw-token
  revocation bypass'
url: https://osv.dev/vulnerability/GHSA-hxm8-2xgr-2p9m
url_hash: 253a988ac409d29c0068059e1baba03b2db88e645d84427da8fdebe883bb6410
canonical_url: https://osv.dev/vulnerability/GHSA-hxm8-2xgr-2p9m
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-102269
- GHSA-hxm8-2xgr-2p9m
- severity:CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
- pyjwt
- PyPI
lang: en
published_at: '2026-09-29T23:17:55Z'
fetched_at: '2026-09-30T03:55:36.272532Z'
updated_at: '2026-09-30T04:20:39Z'
status: published
content_hash: cb492467df6673891e26b68ed85deafdebf5b652d62c232ccd807349e68806b7
content_changed_at: null
license_note: full
summary: 'PyJWT: Non-canonical signature segments enable raw-token revocation bypass'
summary_source: rss
summary_en: 'PyJWT: Non-canonical signature segments enable raw-token revocation bypass'
summary_omitted_reason: null
redistribution: true
keywords_en:
- bypass
- cve
- CVE-2026-102269
- CVE-2026-59980
- enable
- GHSA-hxm8-2xgr-2p9m
- library vulnerability
- Non-canonical
- PyJWT
- PyPI
- raw-token
- revocation
- segments
- severity:CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
- signature
- software security
entities_en:
- name: CVE-2026-59980
  type: concept
- name: PyJWT
  type: artifact
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE-2026-59980
  type: concept
- name: PyJWT
  type: artifact
key_facts: []
related: []
related_auto: []
computed_at: '2026-09-30T04:20:34Z'
---

# CVE-2026-102269: PyJWT: Non-canonical signature segments enable raw-token revocation bypass

## TL;DR
PyJWT: Non-canonical signature segments enable raw-token revocation bypass

## Key Points
- cve / CVE-2026-102269 / GHSA-hxm8-2xgr-2p9m / severity:CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N / pyjwt / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
**Advisory:** GHSA-hxm8-2xgr-2p9m (CVE-2026-102269)

**Details:**
## Summary

PyJWT 2.13.0 accepts compact JWS signature segments containing characters that
are not in the Base64URL alphabet. Appending `!!!!` to a valid signature does
not change the decoded signature bytes or authenticated claims, but it changes
the serialized token and its SHA-256 hash. An application that indexes logout
or revocation state by the raw token therefore rejects the logged-out token and
accepts its no-key alternate serialization.

This report separates two issues: permissive compact-JWS decoding is the
library behavior, while using raw serialized JWT text as a security identity is
a dangerous application composition. A `jti`-indexed control blocks both
representations.

## Affected Version

Confirmed with PyJWT 2.13.0 on CPython 3.13. The mutation changes only the
signature segment and requires no signing key.

## End-to-End Reproduction

```bash
.venv-research/bin/python 06-practical-testing/revocation-bypass-lab.py
```

The loopback-only lab performs:

1. Issue a valid HS256 admin token.
2. Access `/protected` successfully.
3. Log out the canonical token and store `SHA256(raw_token)`.
4. Confirm canonical replay returns HTTP 401.
5. Append `!!!!` to only the signature segment.
6. Confirm the mutated token has the same verified claims and signature bytes,
   a different raw hash, and receives HTTP 200.
7. Repeat with `jti`-indexed revocation and confirm both forms return HTTP 401.

Observed statuses for raw-token revocation were `200 -> logout -> 401` for the
canonical token and `200` for the alternate serialization. The `jti` control
returned `401` for both replays after logout.

## Security Boundaries and Severity

This is not signature forgery: the attacker starts with a valid token and
cannot alter its claims. Impact requires a consumer to bind revocation, replay
state, rate limits, or cache identity to the raw compact string. Under that
composition, an authenticated user can bypass logout or token-specific
revocation without the signing key. Medium is suggested for triage because the
security impact is real but application-dependent.

## Recommended Fix

- Reject signature segments containing characters outside `[A-Za-z0-9_-]`.
- Reject padding and other non-canonical Base64URL encodings for compact JWS.
- Add regression tests proving malformed signature encodings fail before or
  during verification.
- Document that applications must use a semantic identifier such as `jti`, not
  the raw serialized token, for revocation and replay state.

## Maintainer update — 2026-09-09

We reproduced the reported behavior on the verified `master` commit `8915570`: appending `!!!!` to a valid compact-JWS signature segment is accepted, produces the same decoded signature bytes and claims, and changes the serialized token hash. Existing JWS verification controls pass. The behavior is present in the tested release range represented by tags `2.4.0`, `2.8.0`, `2.10.1`, `2.12.1`, and `2.13.0`.

The security impact is conditional on an application using the raw serialized token as the identity for logout, revocation, replay, rate-limit, or cache state. Under that composition, an attacker who already holds a valid token can use an alternate serialization after the canonical string is revoked. This is not signature forgery or claim alteration; applications should use a semantic identifier such as `jti` for token identity.

The report is ready to be accepted as a draft for continued remediation. A narrow fix assessment recommends rejecting non-canonical Base64URL characters and padding in compact-JWS segments. No fix commit or release is claimed yet.

### Maintainer update — 2026-09-09

The fix has been rebased onto the current `master` as `e6f48401001609a8f99e71fcaf355fb895d508a8` and is ready to be pushed. Compact-JWS header, payload, and signature segments are now required to use the unpadded Base64URL alphabet and canonical re-encoding; a signature segment containing non-canonical characters such as `!!!!` is rejected before verification. Valid detached `b64=false` handling remains supported.

Verification on the rebased fix commit passed 372 tests with 4 intentional cryptography-environment skips; Ruff formatting/lint and `git diff --check` passed. The compressed-payload regression fixture was updated to valid canonical compact-JWS encoding. No release containing the fix has been published yet, so the patched version remains unset pending release planning.

The advisory remains medium severity and unpublished.

## Classification update — 2026-09-10

We completed the advisory classification review. The proposed CVSS 3.1 vector is `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N` and the proposed CWE classification is CWE-180. The issue permits alternate non-canonical serializations of an already valid signed token to bypass applications that identify tokens by their raw serialization; it does not forge signatures or alter claims. CWE-180 captures validation/canonicalization ordering.

These metadata changes do not alter the affected range, fix status, or lifecycle state.

## Maintainer update — 2026-09-11

The verified fix for this advisory is included in PyJWT 2.14.0, released on 2026-09-11 and available on PyPI. PyJWT 2.14.0 is the first release containing the fix. This advisory is now published with 2.14.0 recorded as the patched version.

**References:**
- https://github.com/jpadilla/pyjwt/security/advisories/GHSA-hxm8-2xgr-2p9m
- https://nvd.nist.gov/vuln/detail/CVE-2026-102269
- https://github.com/jpadilla/pyjwt/commit/e6f48401001609a8f99e71fcaf355fb895d508a8
- https://github.com/jpadilla/pyjwt
- https://github.com/jpadilla/pyjwt/releases/tag/2.14.0

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-hxm8-2xgr-2p9m_

## Source
元記事: [CVE-2026-102269: PyJWT: Non-canonical signature segments enable raw-token revocation bypass](https://osv.dev/vulnerability/GHSA-hxm8-2xgr-2p9m) — published 2026-09-29T23:17:55Z
