Summary
A crafted workflow submitted to the unauthenticated POST /prompt API can make LoadImage (and sibling annotated-filepath nodes) read files outside the input directory.
Details
LoadImage defines a VALIDATE_INPUTS method, which causes the execution engine to skip COMBO (input-directory) validation. The only remaining guard, folder_paths.exists_annotated_filepath / get_annotated_filepath, joined the user-controlled name to the base directory with no containment check, so ../ sequences escaped it. Affected nodes include LoadImage, LoadImageMask, LoadImageOutput, LoadAudio, LoadLatent, LoadVideo, and Load3D.
Impact
A file-existence oracle (existing files return HTTP 200, missing files HTTP 400) for reconnaissance of arbitrary host paths, plus exfiltration of any image-format file by chaining LoadImage to an output/preview node and retrieving it via /view.
Patches
Fixed in ComfyUI v0.28.0: get_annotated_filepath and exists_annotated_filepath reject paths that escape base_dir (realpath + commonpath).
Workarounds
Do not expose the /prompt API to untrusted clients or accept untrusted workflows.
Summary
A crafted workflow submitted to the unauthenticated
POST /promptAPI can makeLoadImage(and sibling annotated-filepath nodes) read files outside the input directory.Details
LoadImagedefines aVALIDATE_INPUTSmethod, which causes the execution engine to skip COMBO (input-directory) validation. The only remaining guard,folder_paths.exists_annotated_filepath/get_annotated_filepath, joined the user-controlled name to the base directory with no containment check, so../sequences escaped it. Affected nodes include LoadImage, LoadImageMask, LoadImageOutput, LoadAudio, LoadLatent, LoadVideo, and Load3D.Impact
A file-existence oracle (existing files return HTTP 200, missing files HTTP 400) for reconnaissance of arbitrary host paths, plus exfiltration of any image-format file by chaining
LoadImageto an output/preview node and retrieving it via/view.Patches
Fixed in ComfyUI v0.28.0:
get_annotated_filepathandexists_annotated_filepathreject paths that escapebase_dir(realpath+commonpath).Workarounds
Do not expose the
/promptAPI to untrusted clients or accept untrusted workflows.