CVE-2026-56671: Comfy-Org ComfyUI path traversal in model preview endpoint

CVE-2026-56671 · Severity: high · CVSS 7.5 · Published 2026-07-31

ComfyUI, a popular interface for AI image generation models, contains a security flaw in how it handles model preview images. An unauthorized attacker can exploit this to bypass folder restrictions and view sensitive image files stored anywhere on the host server. This could lead to the exposure of private user assets or internal system information, particularly in shared or cloud-based environments.

Technologies: Comfy-Org ComfyUI. Vendors: Comfy-Org.

Quick answers

Is CVE-2026-56671 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-56671 being exploited in the wild.
How severe is CVE-2026-56671?
High severity, with a CVSS score of 7.5, published 31 July 2026.
Which products and versions are affected?
Comfy-Org ComfyUI < 0.28.0.
Is there a fix for CVE-2026-56671?
A patch was published on 2026-07-03: Fix merged into master branch Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-56671 attacked?
It is attacked over the network, in a network appliance.
Am I affected by CVE-2026-56671?
Check whether you run Comfy-Org ComfyUI at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A path traversal vulnerability exists in the `get_model_preview` function within `app/model_manager.py`. The application uses `os.path.join(folder, filename)` where `filename` is an unrestricted route capture (`{filename:.*}`) without a containment check. An unauthenticated remote attacker can use literal `../` sequences, percent-encoded traversal (`%2e%2e%2f`), or absolute paths to escape the intended model directory. While the disclosure is limited to files that can be decoded by the Pillow library (re-encoded as WEBP), the flaw also functions as a file-existence oracle and can leak internal paths via `path_index` errors. The issue is resolved in version 0.28.0 by implementing `realpath` and `os.path.commonpath` validation.

Affected products

  • Comfy-Org ComfyUI < 0.28.0

Timeline

  • 2026-07-03: patched: Fix merged into master branch
  • 2026-07-15: advisory: GitHub Security Advisory published
  • 2026-07-31: disclosed: CVE published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.