Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
HIGH severity

GHSA-w5r5-m38g-f9f9 joserfc

HIGHFix: authlib/joserfc@696a961

GHSA-w5r5-m38g-f9f9 is a high-severity (CVSS 7.5) CWE-770 vulnerability in joserfc. A fix is available for joserfc — see the affected versions and patch details below.

joserfc's PBES2 p2c Unbounded Iteration Count enables Denial of Service (DoS)

Also known asCVE-2026-27932PYSEC-2026-2529
Published
Mar 2, 2026
Updated
Sep 10, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Sep 21, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.

Exploitation and automatability from CISA’s SSVC triage for GHSA-w5r5-m38g-f9f9.

EPSS Exploitation Probability

via FIRST.org ↗
0.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs37th percentile — riskier than 37% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

How urgent is this, really

GHSA-w5r5-m38g-f9f9 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.

Where this sits among everything scored

Of 377,333 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.

Real-World Exposure

1 pkg affected
🐍joserfc

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

Summary

A resource exhaustion vulnerability in joserfc allows an unauthenticated attacker to cause a Denial of Service (DoS) via CPU exhaustion. When the library decrypts a JSON Web Encryption (JWE) token using Password-Based Encryption (PBES2) algorithms, it reads the p2c (PBES2 Count) parameter directly from the token's protected header. This parameter defines the number of iterations for the PBKDF2 key derivation function. Because joserfc does not validate or bound this value, an attacker can specify an extremely large iteration count (e.g., 2^31 - 1), forcing the server to expend massive CPU resources processing a single token.

This vulnerability exists at the JWA layer and impacts all high-level JWE and JWT decryption interfaces if PBES2 algorithms are allowed by the application's policy.

Details

Vulnerable file: src/joserfc/_rfc7518/jwe_algs.py Vulnerable function: PBES2HSAlgKeyEncryption.decrypt_cek() Lines: 283

def decrypt_cek(self, recipient: Recipient[OctKey]) -> bytes:
    headers = recipient.headers()
    # ...
    p2c = headers["p2c"]  # ← attacker-controlled integer
    # ...
    kek = self.compute_derived_key(key.get_op_key("deriveKey"), p2s, p2c)

The p2c value is then passed to compute_derived_key :

def compute_derived_key(self, key: bytes, p2s: bytes, p2c: int) -> bytes:
    # ...
    kdf = PBKDF2HMAC(
        algorithm=self.hash_alg,
        length=self.key_size // 8,
        salt=salt,
        iterations=p2c,  # ← unbounded iterations
        backend=default_backend(),
    )

Impact on JWT Policies Any JWT policy configured to allow PBES2 key management algorithms (e.g., PBES2-HS256+A128KW) is vulnerable. Because the DoS occurs during the decryption phase, the attack is triggered before any claim validation (e.g., exp,iss, aud checks) or nested signature verification takes place. This makes existing JWT "policies" ineffective as a defense if the underlying algorithm is permitted.

PoC

Tested against joserfc 1.6.2. Local Reproduction:

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

Impact

An unauthenticated remote attacker can exhaust the CPU resources of a server by sending a small number of crafted JWE/JWT tokens. Each token will occupy a worker thread/process for a duration proportional to the p2c value (up to several minutes or hours depending on the integer value). This results in a complete Denial of Service for legitimate users.

Recommendation

Minimal fix: Implement an upper bound check for the p2c parameter in PBES2HSAlgKeyEncryption.decrypt_cek().

MAX_P2C = 300000  # Example security bound

# ... inside decrypt_cek ...
p2c = headers["p2c"]
if not isinstance(p2c, int) or p2c > MAX_P2C:
    raise DecodeError(f"p2c iteration count too high (max {MAX_P2C})")

Additionally, applications should only enable PBES2 algorithms if password-based encryption is specifically required and should enforce a strict algorithms allowlist in their JWT/JWE policies.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIjoserfcall versions1.6.3pip install --upgrade 'joserfc==1.6.3'

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for joserfc, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update joserfc to 1.6.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-w5r5-m38g-f9f9 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-w5r5-m38g-f9f9 can be triaged on real exposure rather than presence alone.

Tailored to GHSA-w5r5-m38g-f9f9. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

# Summary A resource exhaustion vulnerability in joserfc allows an unauthenticated attacker to cause a Denial of Service (DoS) via CPU exhaustion. When the library decrypts a JSON Web Encryption (JWE) token using Password-Based Encryption (PBES2) algorithms, it reads the p2c (PBES2 Count) parameter directly from the token's protected header. This parameter defines the number of iterations for the PBKDF2 key derivation function. Because joserfc does not validate or bound this value, an attacker can specify an extremely large iteration count (e.g., 2^31 - 1), forcing the server to expend massi
O3 Security · Impact-Aware SCA

Is GHSA-w5r5-m38g-f9f9 in your dependencies?

O3 Security finds GHSA-w5r5-m38g-f9f9 across PyPI dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-w5r5-m38g-f9f9: joserfc DoS (High 7.5) | O3 Security