CVE-2026-142105: Python-jwcrypto: unbounded key generation from untrusted jwe epk headers and jwk set entries

Published Dec 2, 2026
·
Updated

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

1 affected component
pypi/jwcrypto

Event History

Dec 2, 2026
Data Sourced
via Red Hat·12:55 PM
DescriptionSeverityAffected Software
CVE Published
via MITRE·05:14 PM
Data Sourced
via MITRE·05:14 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

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.

2

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.

3

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203