Summary
The /view endpoint served uploaded SVG files inline because image/svg+xml was missing from its dangerous-Content-Type blocklist, allowing stored XSS.
Details
/view's blocklist forced application/octet-stream for HTML/JS/CSS but omitted image/svg+xml, and it did not set Content-Disposition: attachment. An attacker uploads (unauthenticated by default, e.g. via /upload/image) a malicious SVG carrying inline <script>; opening /view?filename=evil.svg&type=input renders it inline and executes the script same-origin, bypassing the cross-site origin checks.
Impact
Same-origin script can exfiltrate the JavaScript-accessible Comfy API token, read browser-stored workflows and settings, and issue authenticated-equivalent API calls.
Patches
Fixed in ComfyUI v0.28.0: image/svg+xml and the wider XML dialect family are routed through is_dangerous_content_type to a forced download (application/octet-stream + attachment + nosniff).
Workarounds
Do not open untrusted /view SVG URLs; restrict access to the ComfyUI instance.
Summary
The
/viewendpoint served uploaded SVG files inline becauseimage/svg+xmlwas missing from its dangerous-Content-Type blocklist, allowing stored XSS.Details
/view's blocklist forcedapplication/octet-streamfor HTML/JS/CSS but omittedimage/svg+xml, and it did not setContent-Disposition: attachment. An attacker uploads (unauthenticated by default, e.g. via/upload/image) a malicious SVG carrying inline<script>; opening/view?filename=evil.svg&type=inputrenders it inline and executes the script same-origin, bypassing the cross-site origin checks.Impact
Same-origin script can exfiltrate the JavaScript-accessible Comfy API token, read browser-stored workflows and settings, and issue authenticated-equivalent API calls.
Patches
Fixed in ComfyUI v0.28.0:
image/svg+xmland the wider XML dialect family are routed throughis_dangerous_content_typeto a forced download (application/octet-stream+ attachment +nosniff).Workarounds
Do not open untrusted
/viewSVG URLs; restrict access to the ComfyUI instance.