CVE-2026-119284: joserfc: Compact JWS size guard allocates attacker-controlled segments before rejection
The Python library joserfc checked its compact JWS size limits only after calling `split(b".")`, which copies the attacker-controlled segments. Each oversized token therefore cost about one extra payload-sized allocation before it was rejected. This is a small memory-amplification flaw. Versions before 1.7.6 are affected. Upgrade to 1.7.6.
Published Oct 30, 2026 · Analysis Oct 31, 2026
What an attacker can do
joserfc 1.7.4 defines limits for the header, payload and signature of compact JWS tokens. deserialize_compact() split the value on dots first and validated the pieces afterwards. In Python, bytes.split() makes copies, so the guard created an attacker-sized object before it raised ExceededSizeError. The reporter's profile shows a peak memory increase equal to the input size, about 1.0x, from 1 MiB up to 64 MiB, with every signature invalid and every input rejected for size.
So this is not a large amplification. The attacker needs only the ability to send a token to code that calls deserialize_compact(), such as an unauthenticated login or API endpoint that verifies JWTs. Each request holds roughly twice the token size in memory for a moment. Many parallel large requests can push a worker toward its memory limit, and a stress test with a tight address-space limit produced MemoryError. The report does not claim a realistic memory budget. The effect is availability only, and the transport layer or web server can still cap request size before the token reaches joserfc.
Who is affected
Affected: the joserfc Python package before 1.7.6, in code that passes untrusted compact JWS tokens to deserialize_compact(). The same split-then-check order existed in the JWE compact path, which the fix also covers. Services that cap header and body size at the proxy or framework layer have limited exposure.
Check the installed version:
pip show joserfcjoserfc
- Ecosystem
- PyPI
- Affected
- < 1.7.6
- Fixed in
- 1.7.6
- Check
pip show joserfc
How to fix it
Upgrade to joserfc 1.7.6:
pip install --upgrade joserfc==1.7.6The fix (commit 397e04f4) adds validate_compact_value_size to the JWS and JWE registries and calls it before splitting. The total length of the compact value must not exceed the sum of the registry's per-part maximums, and larger input raises ExceededSizeError. As a stopgap, limit request header and body size at your reverse proxy or application server, so oversized tokens never reach joserfc.
How to tell if you were hit
Look for requests to token-verifying endpoints with very large Authorization headers, cookies or form fields, and for ExceededSizeError in application logs. Watch worker memory for spikes that line up with failed authentication attempts, and for MemoryError or out-of-memory kills of workers that verify tokens. A burst of invalid-signature or oversize rejections from one source address is a sign of probing.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
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
.venv-research/bin/python 06-practical-testing/preauth-memory-profile.pyThe 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, 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.
Credited to ze3tar.
Questions
- How bad is the joserfc memory issue in CVE-2026-119284?
Limited. The report measured about 1.0x amplification, so each oversized token costs roughly one extra copy of its size before rejection. It needs many large requests to matter. It affects availability only.
- Does it need authentication?
No. Any caller that can get a token string to
deserialize_compact()can trigger it, for example on a pre-authentication endpoint.- Which version fixes it?
1.7.6. Earlier versions check the size after splitting.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-119283
joserfc: Unbounded JWE General JSON `recipients` Array Leads to CPU Exhaustion (DoS) via Repeated RSA Private-Key Decryption
high7.5Oct 30, 2026CVE-2026-49852
joserfc: HS256/HS384/HS512 verify accepts empty/nil HMAC key (cross-language sibling of CVE-2026-45363)
high8.7Jul 2, 2026CVE-2026-48990
joserfc: b64=false RFC7797 JWS payloads bypass JWSRegistry payload-size limits during deserialization
medium5.3Jun 26, 2026CVE-2026-27932
joserfc's PBES2 p2c Unbounded Iteration Count enables Denial of Service (DoS)
high7.5Mar 2, 2026CVE-2025-65015
joserfc has Possible Uncontrolled Resource Consumption Vulnerability Triggered by Logging Arbitrarily Large JWT Token Payloads
critical9.2Nov 18, 2025
