---
schema_version: '1.0'
id: security-20261031-563603
title: 'CVE-2026-119284: joserfc: Compact JWS size guard allocates attacker-controlled
  segments before rejection'
url: https://osv.dev/vulnerability/GHSA-9pg5-8c7x-5hfx
url_hash: 563603922d594c9ff2dc93a3e5d4254493e0431e2d3326b8f355fe46ba343068
canonical_url: https://osv.dev/vulnerability/GHSA-9pg5-8c7x-5hfx
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-119284
- GHSA-9pg5-8c7x-5hfx
- severity:CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
- joserfc
- PyPI
lang: en
published_at: '2026-10-30T14:54:25Z'
fetched_at: '2026-10-31T03:19:44.396808Z'
updated_at: '2026-10-31T10:18:27Z'
status: published
content_hash: 232e3fafda135c3b282b7fc02241cc56df3886abc55f80209bd79f1c17b2be1e
content_changed_at: null
license_note: full
summary: 'joserfc: Compact JWS size guard allocates attacker-controlled segments before
  rejection'
summary_source: rss
summary_en: 'joserfc: Compact JWS size guard allocates attacker-controlled segments
  before rejection'
summary_omitted_reason: null
redistribution: true
keywords_en:
- allocates
- attacker-controlled
- before
- Compact
- cve
- CVE-2026-119284
- GHSA-9pg5-8c7x-5hfx
- guard
- joserfc
- JWS
- library vulnerability
- Male Insecurity Over Penis Size
- PyPI
- PyPIのBrotliパッケージ
- rejection
- segments
- severity:CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
- Shay McVeigh
- size
- software security
- The Guardian
entities_en:
- name: Male Insecurity Over Penis Size
  type: UNKNOWN
- name: PyPIのBrotliパッケージ
  type: organization
- name: Shay McVeigh
  type: person
- name: The Guardian
  type: organization
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: Shay McVeigh
  type: person
- name: PyPIのBrotliパッケージ
  type: organization
- name: Male Insecurity Over Penis Size
  type: UNKNOWN
- name: The Guardian
  type: organization
key_facts: []
related: []
related_auto:
- name: Manhood
  type: content
  weight: 1.0
computed_at: '2026-10-31T10:18:25Z'
---

# CVE-2026-119284: joserfc: Compact JWS size guard allocates attacker-controlled segments before rejection

## TL;DR
joserfc: Compact JWS size guard allocates attacker-controlled segments before rejection

## Key Points
- cve / CVE-2026-119284 / GHSA-9pg5-8c7x-5hfx / severity:CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N / joserfc / PyPI

## Details
**Severity:** CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
**Advisory:** GHSA-9pg5-8c7x-5hfx (CVE-2026-119284)

**Details:**
## Summary

joserfc 1.7.4 defines compact-JWS header, payload, and signature limits, but
calls `value.split(b".")` before validating them. Python `bytes.split()` copies
the attacker-controlled segments, so the current guard allocates roughly one
complete payload before rejecting it.

## Reproduction

```bash
.venv-research/bin/python 06-practical-testing/preauth-memory-profile.py
```

The input is resident before a fork-isolated verifier runs, and every signature
is invalid.

| Input | Peak RSS delta | Amplification | Result |
|---:|---:|---:|---|
| 1 MiB | 1.11 MiB | 1.11× | size rejected |
| 4 MiB | 4.04 MiB | 1.01× | size rejected |
| 8 MiB | 8.04 MiB | 1.01× | size rejected |
| 16 MiB | 16.04 MiB | 1.00× | size rejected |
| 32 MiB | 31.74 MiB | 0.99× | size rejected |
| 64 MiB | 63.80 MiB | 1.00× | size rejected |

The unconstrained profile is the primary evidence: joserfc allocates an
additional attacker-sized object before producing its intended
`ExceededSizeError`. A separate baseline-plus-headroom stress test raises
`MemoryError` when that copy cannot fit, but this report does not characterize
an absolute `RLIMIT_AS` value as a realistic worker memory budget.

## Security Argument

The issue is not that joserfc can prevent the transport layer from receiving a
large header. The issue is narrower: once bytes reach `deserialize_compact()`,
the library's existing size guard cannot fulfill its allocation-limiting purpose
because attacker-controlled segment copies are created first.

This differs from
[GHSA-frfh-8v73-gjg4](https://github.com/authlib/joserfc/security/advisories/GHSA-frfh-8v73-gjg4),
which concerned embedding already-loaded oversized segments in exception and log
messages. Here, the current implementation itself creates an additional
payload-sized allocation before its fixed size exception.

## Recommended Fix

Check `len(value)` against a maximum compact-serialization size before
`split()`. If per-segment diagnostics are needed, locate delimiters with bounded
`find()` operations or memory views, validate offsets and lengths, and only then
materialize acceptable segments.

**References:**
- https://github.com/authlib/joserfc/security/advisories/GHSA-9pg5-8c7x-5hfx
- https://nvd.nist.gov/vuln/detail/CVE-2026-119284
- https://github.com/authlib/joserfc/commit/397e04f4bbce0b94d86e31c1c003f4640af8fb39
- https://github.com/authlib/joserfc
- https://github.com/authlib/joserfc/releases/tag/1.7.6

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-9pg5-8c7x-5hfx_

## Source
元記事: [CVE-2026-119284: joserfc: Compact JWS size guard allocates attacker-controlled segments before rejection](https://osv.dev/vulnerability/GHSA-9pg5-8c7x-5hfx) — published 2026-10-30T14:54:25Z
