CVE-2026-123790
Path traversal in ComfyUI-Easy-Use 1.3.6 allows overwriting custom node code.
- CWE-22
- Input Validation and Sanitization
- Remote
ComfyUI-Easy-Use version 1.3.6 contains a path traversal vulnerability in the `save_preview()` handler for POST `/easyuse/save/{name}`. The handler checks the source directory before appending a user-supplied filename and allows the request to select the `custom_nodes` directory as a copy destination. An unauthenticated attacker who can reach the ComfyUI server can overwrite an installed custom node’s Python entry point with an uploaded file. When ComfyUI restarts and loads the modified node, the attacker’s code runs with the privileges of the ComfyUI process.
- CWE
- CWE-22
- Published
- 2026-11-12
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Assignment
- Code defect classification
- Incorrect Check
- Category
- Input Validation and Sanitization
- Subcategory
- Path Traversal
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- ComfyUI-Easy-Use
Solution
Upgrade ComfyUI‑Easy‑Use to version 1.3.7 or later, which removes the path‑traversal flaw in the save_preview() handler.
Vulnerable code sample
import os
def save_preview(name: str, data: bytes) -> None:
# VULNERABLE: directly joins user‑supplied filename allowing '..' traversal
base_dir = os.path.abspath("custom_nodes")
file_path = os.path.join(base_dir, name)
with open(file_path, "wb") as f:
f.write(data)Patched code sample
import os
def save_preview(name: str, data: bytes) -> None:
# FIX: validate that the resolved path stays within the intended directory
base_dir = os.path.abspath("custom_nodes")
candidate = os.path.abspath(os.path.join(base_dir, name))
if not candidate.startswith(base_dir + os.sep):
raise ValueError("Invalid filename: path traversal detected")
with open(candidate, "wb") as f:
f.write(data)Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- fix: harden model metadata and preview routes (#1045) (yolain/ComfyUI-Easy-Use)
py/routes.py,py/routes.py · load_metadata,py/routes.py · reboot,py/routes.py · save_notes,py/routes.py · save_preview
Cite this entry
@misc{vaitp:cve2026123790,
title = {{Path traversal in ComfyUI-Easy-Use 1.3.6 allows overwriting custom node code.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-123790},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-123790/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
