Inefficient Algorithmic ComplexityAffected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the JWK.import_key() method, whose key_ops duplicate detection rescans the whole array for every element and enforces no size limit, making the check O(n^2) over untrusted parsed JWK data. An attacker can occupy a CPU core for minutes with a sub-megabyte request body, and exhaust a server with a handful of concurrent requests, by submitting a key such as {"kty":"oct","k":"AAAA","key_ops":[...]} carrying roughly 50,000 distinct operations. This requires the application to import attacker-supplied JWK or JWK Sets through import_key() or the related from_json() and import_keyset() entry points, as in dynamic client registration, DPoP, ACME account keys, or federated JWKS endpoints, and relying parties that import keys only from fixed trusted issuers are unexposed.
How to fix Inefficient Algorithmic Complexity? Upgrade jwcrypto to version 1.6.1 or higher.
| |
Allocation of Resources Without Limits or ThrottlingAffected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the JWE.deserialize() method (jwcrypto/jwe.py:555), which calls raw_jwe.split('.') on the input before checking that the compact serialization has the required five segments . An attacker can trigger a MemoryError and pressure or interrupt the worker by submitting a compact JWE string containing millions of period delimiters, forcing an unbounded list allocation before the len(data) != 5 check runs. The same pattern is present in the JWS deserializer, and exploitation is constrained where the application caps the maximum token size before deserialization.
How to fix Allocation of Resources Without Limits or Throttling? Upgrade jwcrypto to version 1.5.9 or higher.
| |