Description
ComfyUI is a node-based diffusion model GUI, API, and backend. Prior to 0.28.0, GET /userdata/{file} served user-controlled HTML and SVG files with extension-derived content types, allowing stored cross-site scripting in the ComfyUI origin and access to browser-stored API tokens, settings, workflows, and authenticated-equivalent API calls. The handler used web.FileResponse(path), so an uploaded .html/.svg was served as text/html/image/svg+xml. POST /userdata stores arbitrary request bodies (confined to the user's userdata directory). When a victim navigated to the file URL, the embedded script executed same-origin. The /view endpoint already forced dangerous MIME types to download; that protection had never been applied to /userdata. This issue is fixed in version 0.28.0.
Published: 2026-07-31
Score: 8.2 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The ComfyUI server exposes a /userdata/{file} endpoint that serves user‑supplied HTML and SVG files with MIME types derived solely from the file extension. Because the handler uses a web.FileResponse on the provided path, an attacker who can place a malicious .html or .svg file into a user's data directory can cause the browser to interpret it as text/html or image/svg+xml and execute embedded JavaScript. The code runs with the same origin as ComfyUI, giving the attacker access to any browser‑stored API tokens, user settings, and the ability to perform authenticated‑equivalent requests on behalf of the victim. No input sanitization or Content‑Disposition controls were applied to the userdata route, which enabled the stored XSS vector.

Affected Systems

The flaw exists in all versions of the Comfy‑Org ComfyUI product before release 0.28.0; version 0.28.0 and newer contain a fix that properly sanitizes content types and changes the /userdata endpoint so that files are served as downloads rather than inline content. Users running older releases are susceptible if they have not removed hostile .html or .svg files from their userdata directories.

Risk and Exploitability

The vulnerability carries a CVSS score of 8.2 (High) and an EPSS score of less than 1 %, indicating a low probability of exploitation detected in the public threat landscape but still a real risk for exposed servers. The exploitable path requires an attacker to upload a malicious file to the target's userdata directory and for a victim to load that file in a browser; thus the attack can be triggered remotely if a user is lured to the file URL. The flaw is not listed in the CISA KEV catalog, so no known active exploit is documented, but its high severity justifies prioritizing a patch or mitigative controls.

Generated by OpenCVE AI on August 2, 2026 at 04:35 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the ComfyUI 0.28.0 patch or later to fix the MIME‑type handling for the /userdata endpoint
  • If an immediate upgrade is impossible, configure the application or reverse‑proxy to force a safe Content‑Disposition header or set the MIME type to application/octet‑stream for responses from /userdata, ensuring browsers download rather than display the content
  • Search the userdata directories for .html or .svg files that could contain malicious scripts and delete any that are not required; consider implementing a scheduled scan or a file‑type whitelist to prevent future uploads of executable content
  • Monitor user activity for unexpected file uploads and implement logging to detect unauthorized changes to the userdata folder

Generated by OpenCVE AI on August 2, 2026 at 04:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sun, 02 Aug 2026 19:45:00 +0000

Type Values Removed Values Added
First Time appeared Comfy
Comfy comfyui
Vendors & Products Comfy
Comfy comfyui

Fri, 31 Jul 2026 11:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 31 Jul 2026 05:30:00 +0000

Type Values Removed Values Added
Description ComfyUI is a node-based diffusion model GUI, API, and backend. Prior to 0.28.0, GET /userdata/{file} served user-controlled HTML and SVG files with extension-derived content types, allowing stored cross-site scripting in the ComfyUI origin and access to browser-stored API tokens, settings, workflows, and authenticated-equivalent API calls. The handler used web.FileResponse(path), so an uploaded .html/.svg was served as text/html/image/svg+xml. POST /userdata stores arbitrary request bodies (confined to the user's userdata directory). When a victim navigated to the file URL, the embedded script executed same-origin. The /view endpoint already forced dangerous MIME types to download; that protection had never been applied to /userdata. This issue is fixed in version 0.28.0.
Title ComfyUI: Stored XSS via /userdata/{file} due to Missing Content-Type Sanitization
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 8.2, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-31T11:06:19.744Z

Reserved: 2026-06-22T16:39:01.043Z

Link: CVE-2026-56672

cve-icon Vulnrichment

Updated: 2026-07-31T11:06:15.951Z

cve-icon NVD

Status : Received

Published: 2026-07-31T06:16:30.170

Modified: 2026-07-31T11:17:10.903

Link: CVE-2026-56672

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-02T19:30:17Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')