CVE-2026-142105: Python-jwcrypto: unbounded key generation from untrusted jwe epk headers and jwk set entries
A flaw was found in python-jwcrypto. A remote attacker can trigger a Denial of Service (DoS) by sending crafted JSON Web Encryption (JWE) header data or JSON Web Key (JWK) set entries that force the library to generate cryptographic keys of arbitrary types and unbounded sizes. This processing occurs prior to cryptographic authentication, allowing an attacker to cause excessive memory allocation or prolonged CPU utilization during key generation. As a result, the application can become unresponsive or crash.
Other sources
A flaw was found in python-jwcrypto. The JWK constructor still honours the deprecated generate keyword, and two code paths build a JWK from untrusted data through that constructor: the ECDH-ES epk header processed during JWE decryption, and individual entries imported through JWKSet. An attacker-supplied epk header or JWK Set entry such as {"generate": "oct", "size": ...} makes jwcrypto generate a key of the attacker's chosen type and unbounded size, for JWE before any authentication tag check and without any key material. A crafted 146-byte token was shown to cause roughly 1.1 GB of memory allocation per decryption attempt, and a large RSA size stalls the worker in key generation for minutes, potentially resulting in a denial of service.
— Red Hat
Affected Software
Event History
Frequently Asked Questions
Does an attacker need a valid JWE, cryptographic key material, or prior authentication to trigger the issue?
No. The affected JWE decryption path processes the attacker-controlled ECDH-ES epk header before authentication-tag verification, and the attacker does not need to provide key material.
Which application workflows are exposed?
Applications are exposed when they decrypt JWE data using ECDH-ES or import individual entries from an untrusted JWK Set. Both paths can construct a JWK from attacker-controlled data using the deprecated generate keyword.
What operational impact can a small malicious input cause?
A crafted 146-byte token was shown to allocate roughly 1.1 GB of memory for each decryption attempt. Requests specifying a large RSA key size can also stall a worker during key generation.