DEV Community

CVE Reports
CVE Reports

Posted on Originally published at cvereports.com

CVE-2026-119283: CVE-2026-119283: Unbounded JWE Recipients Array Causes CPU Exhaustion in Authlib joserfc

CVE-2026-119283: Unbounded JWE Recipients Array Causes CPU Exhaustion in Authlib joserfc

Vulnerability ID: CVE-2026-119283
CVSS Score: 7.5
Published: 2026-10-30

A resource consumption vulnerability exists in the Authlib joserfc Python library prior to version 1.7.5. When processing JSON Web Encryption (JWE) objects formatted using General JSON Serialization, the library fails to enforce an upper bound on the number of elements within the recipients array. An unauthenticated attacker can supply a JWE containing thousands of recipient entries targeting an RSA key management algorithm, forcing the server to perform an equivalent number of computationally expensive RSA private-key decryption operations per request and exhausting available CPU resources.

TL;DR

Authlib joserfc versions prior to 1.7.5 do not limit the size of the JWE General JSON Serialization recipients array and fail to short-circuit decryption loops when verify_all_recipients is disabled. Attackers can send a single JWE request containing thousands of RSA recipient blocks to trigger repeated private-key modular exponentiation, causing a high-impact denial of service via CPU exhaustion.


⚠️ Exploit Status: POC

Technical Details

  • Vulnerability Class: CWE-400: Uncontrolled Resource Consumption
  • Attack Vector: Network (Unauthenticated JWE General JSON payload)
  • CVSS v3.1 Score: 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)
  • EPSS Score: 0.23% (13.73rd percentile)
  • Security Impact: Denial of Service via CPU exhaustion from repeated RSA decryptions
  • Affected Function: joserfc.jwe.decrypt_json() / _perform_decrypt()
  • Patched Version: joserfc 1.7.5
  • CISA KEV Status: Not Listed

Affected Systems

  • Authlib joserfc Python library (< 1.7.5)
  • joserfc: < 1.7.5 (Fixed in: 1.7.5)

Code Analysis

Commit: d6dc8df

Enforce max_recipients limit in JWERegistry and short-circuit recipient decryption when verify_all_recipients is False

--- a/src/joserfc/_rfc7516/registry.py
+++ b/src/joserfc/_rfc7516/registry.py
@@ -62,13 +63,16 @@ class JWERegistry:
     max_ciphertext_length: int = 65536  # 64KB
     #: max auth tag's size in bytes
     max_auth_tag_length: int = 64
+    #: max number of recipients in JWE General JSON Serialization
+    max_recipients: int = 16
--- a/src/joserfc/_rfc7516/json.py
+++ b/src/joserfc/_rfc7516/json.py
@@ -76,12 +76,14 @@ def extract_general_json(data: GeneralJSONSerialization, registry: JWERegistry)
     unprotected = data.get("unprotected")
+    recipients = data["recipients"]
+    registry.validate_recipient_count(recipients)
     base64_segments, bytes_segments, aad = __extract_segments(data, registry)
--- a/src/joserfc/_rfc7516/message.py
+++ b/src/joserfc/_rfc7516/message.py
@@ -102,17 +102,20 @@ def _perform_decrypt(obj: EncryptionData, registry: JWERegistry) -> None:
         except (AssertionError, JoseError) as error:
             if registry.verify_all_recipients:
                 raise error
+        else:
+            if not registry.verify_all_recipients:
+                break
Enter fullscreen mode Exit fullscreen mode

Mitigation Strategies

  • Upgrade joserfc to version 1.7.5 or later to enforce the default 16-recipient limit on JWE General JSON Serialization objects.
  • Configure JWERegistry with a lower max_recipients value (e.g., max_recipients=1 or 2) and set verify_all_recipients=False if full multi-recipient verification is not required by the application architecture.
  • Use joserfc.jwe.decrypt_compact() instead of decrypt_json() on endpoints that only need to support JWE Compact Serialization.
  • Enforce HTTP request body size limits and JSON array length validation at the API gateway or WAF layer.

Remediation Steps:

  1. Audit Python dependency manifests (requirements.txt, pyproject.toml, Pipfile.lock, poetry.lock) for versions of joserfc prior to 1.7.5.
  2. Run pip install --upgrade 'joserfc>=1.7.5' in affected environments and rebuild application containers.
  3. Review all calls to joserfc.jwe.decrypt_json() and pass a customized JWERegistry(max_recipients=N, verify_all_recipients=False) matching business requirements.
  4. Verify the remediation by running unit tests that submit a JWE General JSON payload exceeding max_recipients and confirming ExceededSizeError is raised.

References


Read the full report for CVE-2026-119283 on our website for more details including interactive diagrams and full exploit analysis.

Top comments (0)