# CVE-2025-65015: joserfc has Possible Uncontrolled Resource Consumption Vulnerability Triggered by Logging Arbitrarily Large JWT Token Payloads

> Attackers can cause resource exhaustion by sending large JWTs, triggering excessive logging in joserfc, requiring a non-default or missing web server configuration.

- **Severity:** Critical 9.2 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Nov 2025
- **Updated:** 19 Nov 2025
- **Also known as:** DEBIAN-CVE-2025-65015, GHSA-frfh-8v73-gjg4, PYSEC-2026-361, UBUNTU-CVE-2025-65015

## What is CVE-2025-65015?

CVE-2025-65015 is a critical denial of service vulnerability in authlib joserfc, published on 18 Nov 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

joserfc is a Python library that provides an implementation of several JSON Object Signing and Encryption (JOSE) standards. In versions from 1.3.3 to before 1.3.5 and from 1.4.0 to before 1.4.2, the ExceededSizeError exception messages are embedded with non-decoded JWT token parts and may cause Python logging to record an arbitrarily large, forged JWT payload. In situations where a misconfigured — or entirely absent — production-grade web server sits in front of a Python web application, an attacker may be able to send arbitrarily large bearer tokens in the HTTP request headers. When this occurs, Python logging or diagnostic tools (e.g., Sentry) may end up processing extremely large log messages containing the full JWT header during the joserfc.jwt.decode() operation. The same behavior also appears when validating claims and signature payload sizes, as the library raises joserfc.errors.ExceededSizeError() with the full payload embedded in the exception message. Since the payload is already fully loaded into memory at this stage, the library cannot prevent or reject it. This issue has been patched in versions 1.3.5 and 1.4.2.

Weakness: CWE-770 (Allocation of Resources Without Limits or Throttling)

## Which versions are affected by CVE-2025-65015?

5 open source packages ship an affected version, including joserfc. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `joserfc` | PyPI | From 1.3.3 | 1.3.5, 1.4.2 |
| `joserfc` | PyPI | From 1.3.3 | 1.3.5 |
| `joserfc` | PyPI | From 1.3.3 | 1.3.5 |
| `joserfc` | PyPI | From 1.4.0 | 1.4.2 |
| `joserfc` | PyPI | From 1.4.0 | 1.4.2 |

Products: Hsiaoming Joserfc.

## How do I fix CVE-2025-65015?

Upgrade joserfc to a fixed version for your release line: 1.3.5 or 1.4.2.

## Is CVE-2025-65015 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-65015 exists.

## Other vulnerabilities in authlib joserfc

- [CVE-2026-27932](https://insights.sbomify.com/CVE-2026-27932/): joserfc PBES2 p2c Unbounded Iteration Count enables Denial of Service (DoS) (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-65015 and fix it if it is affected.

What it is: CVE-2025-65015 is a critical denial of service vulnerability in authlib joserfc, published on 18 Nov 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-65015 exists.

Affected packages and fixed versions:
- joserfc (PyPI): affected from 1.3.3; fixed in 1.3.5, 1.4.2
- joserfc (PyPI): affected from 1.3.3; fixed in 1.3.5
- joserfc (PyPI): affected from 1.3.3; fixed in 1.3.5
- joserfc (PyPI): affected from 1.4.0; fixed in 1.4.2
- joserfc (PyPI): affected from 1.4.0; fixed in 1.4.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-65015/ (Markdown: https://insights.sbomify.com/CVE-2025-65015/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-65015
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-65015
- OSV: https://osv.dev/vulnerability/CVE-2025-65015

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-65015/
Summaries are generated and may contain mistakes; the official description above is the record.
