jwcrypto@1.5.2

Implementation of JOSE Web standards

  • latest version

    1.6.1

  • latest non vulnerable version

  • first published

    11 years ago

  • latest version published

    24 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the jwcrypto package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Inefficient Algorithmic Complexity

    Affected 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.

    [,1.6.1)
    • M
    Allocation of Resources Without Limits or Throttling

    Affected 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.

    [,1.5.9)
    • M
    Improper Handling of Highly Compressed Data (Data Amplification)

    Affected versions of this package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) through the JWE decompression that has no upper limit for plaintext size. An attacker can exhaust system memory by sending specially crafted compressed tokens that decompress to a much larger size than the input, potentially causing denial of service on memory-constrained systems.

    Note:

    This issue is due to incomplete fix for CVE-2024-28102.

    How to fix Improper Handling of Highly Compressed Data (Data Amplification)?

    Upgrade jwcrypto to version 1.5.7 or higher.

    [,1.5.7)
    • M
    Denial of Service (DoS)

    Affected versions of this package are vulnerable to Denial of Service (DoS) due to the deserialize function. An attacker can cause a denial of service by passing in a malicious JWE Token with a high compression ratio. When the server processes this token, it will consume a lot of memory and processing time.

    How to fix Denial of Service (DoS)?

    Upgrade jwcrypto to version 1.5.6 or higher.

    [0.5.0,1.5.6)