VAITP Dataset

← Back to the dataset

CVE-2026-119284

Memory exhaustion via JWS compact deserialization before size check.

  • CVSS 6.9
  • CWE-400
  • Resource Management
  • Remote

joserfc is a Python library that provides an implementation of several JSON Object Signing and Encryption (JOSE) standards. Prior to 1.7.6, joserfc compact JWS deserialization calls bytes.split() before enforcing the existing aggregate segment-size limits. When attacker-controlled compact serialization bytes reach deserialize_compact(), the split creates copies of the header, payload, and signature segments before ExceededSizeError rejects them, causing an additional allocation approximately proportional to the supplied token. Requests that exhaust available process memory can therefore cause an availability failure even though signature verification fails. This issue is fixed in version 1.7.6.

CVSS base score
6.9
Published
2026-10-29
OWASP
A04 Insecure Design
Orthogonal defect classification
Timing/Serialization
Code defect classification
Serialization Issues
Category
Resource Management
Subcategory
Resource Exhaustion
Accessibility scope
Remote
Impact
Denial of Service (DoS)
Affected component
Python
Fixed by upgrading
Yes

Solution

Upgrade joserfc to version 1.7.6 or later.

Vulnerable code sample

import joserfc
from joserfc.jws import JWSRegistry
from joserfc.errors import ExceededSizeError

MAX_SEGMENT = 8192  # bytes

def deserialize_compact(token: bytes):
    # VULNERABLE: split creates copies before size check
    header, payload, signature = token.split(b'.')
    for seg in (header, payload, signature):
        if len(seg) > MAX_SEGMENT:
            raise ExceededSizeError("segment too large")
    # proceed with verification (omitted)
    return JWSRegistry().deserialize_compact(token)

Patched code sample

import joserfc
from joserfc.jws import JWSRegistry
from joserfc.errors import ExceededSizeError

MAX_SEGMENT = 8192  # bytes

def deserialize_compact(token: bytes):
    # FIX: enforce size limits before copying segments
    mv = memoryview(token)
    first = mv.tobytes().find(b'.')
    second = mv.tobytes().find(b'.', first + 1)
    if first == -1 or second == -1:
        raise ValueError("invalid compact serialization")
    if first > MAX_SEGMENT or (second - first - 1) > MAX_SEGMENT or (len(token) - second - 1) > MAX_SEGMENT:
        raise ExceededSizeError("segment too large")
    header = bytes(mv[:first])
    payload = bytes(mv[first + 1:second])
    signature = bytes(mv[second + 1:])
    # proceed with verification (omitted)
    return JWSRegistry().deserialize_compact(token)

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • fix: validate compact value size before split (authlib/joserfc)
    src/joserfc/_rfc7515/registry.py, src/joserfc/_rfc7516/compact.py · extract_compact, src/joserfc/_rfc7516/registry.py, src/joserfc/_rfc7797/compact.py · extract_rfc7515_compact

Cite this entry

@misc{vaitp:cve2026119284,
  title        = {{Memory exhaustion via JWS compact deserialization before size check.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-119284},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-119284/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.