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.
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.
JWCrypto implements JWK, JWS, and JWE specifications using python-cryptography. Prior to 1.5.7, an unauthenticated attacker can exhaust server memory by sending crafted JWE tokens with ZIP compression. The existing patch for CVE-2024-28102 limits input token size to 250KB but does not validate the decompressed output size. An unauthenticated attacker can cause memory exhaustion on memory-constrained systems. A token under the 250KB input limit can decompress to approximately 100MB. This vulnerability is fixed in 1.5.7.
A vulnerability was found in JWCrypto. This flaw allows an attacker to cause a denial of service (DoS) attack and possible password brute-force and dictionary attacks to be more resource-intensive. This issue can result in a large amount of computational consumption, causing a denial of service attack.