[GH-ISSUE #594] [Exploit] Arbitrarty code execution possible on client machine from third party sites. #272

Closed
opened 2026-10-27 21:15:34 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @vivax3794 on GitHub (Apr 21, 2024).
Original GitHub issue: https://github.com/Comfy-Org/ComfyUI-Manager/issues/594

The issue

You can install custom nodes from a git url, this ofc is done by exposing a api endpoint for this. And ofc installing untrusted nodes can lead to Rce, but thats just common sense, not a security issue.

The issue comes in when a webpage can redirect a user to that download url, like I do here: https://vivax3794.github.io/ignore_nothing_to_see/, this will (assuming the user has comfyui running on port 8188, the default) run a python script on their computer using install.py (mine just opens notepad as a proof of concept)

How to fix

This is the exact type of exploit CORS is suppose to fix, and it is stopping the obvious way of doing this exploit, which is just doing a fetch on load, but you can just redirect the user to a url to simulate a GET, which will not be stopped by CORS.

The way to fix this is to make the "install from git url" endpoint be a POST instead of a GET, this would make it impossible to trigger from redirect, and hence also impossible to call from third party sites.

Code

the full code used in this exploit is here: https://github.com/vivax3794/ignore_nothing_to_see

Other places

Similar exploits might be in other places of the code base (as well as comfy it self), I am not super familiar with the codebase so havent checked, but any endpoints that could lead to code execution should not be GET.

Originally created by @vivax3794 on GitHub (Apr 21, 2024). Original GitHub issue: https://github.com/Comfy-Org/ComfyUI-Manager/issues/594 # The issue You can install custom nodes from a git url, this ofc is done by exposing a api endpoint for this. And ofc installing untrusted nodes can lead to Rce, but thats just common sense, not a security issue. The issue comes in when a webpage can redirect a user to that download url, like I do here: <https://vivax3794.github.io/ignore_nothing_to_see/>, this will (assuming the user has comfyui running on port 8188, the default) run a python script on their computer using `install.py` (mine just opens notepad as a proof of concept) # How to fix This is the **exact** type of exploit CORS is suppose to fix, and it is stopping the obvious way of doing this exploit, which is just doing a fetch on load, *but* you can just redirect the user to a url to simulate a GET, which will not be stopped by CORS. The way to fix this is to make the "install from git url" endpoint be a POST instead of a GET, this would make it impossible to trigger from redirect, and hence also impossible to call from third party sites. # Code the full code used in this exploit is here: https://github.com/vivax3794/ignore_nothing_to_see # Other places Similar exploits might be in other places of the code base (as well as comfy it self), I am not super familiar with the codebase so havent checked, but any endpoints that could lead to code execution should not be GET.
Author
Owner

@MatissesProjects commented on GitHub (Apr 21, 2024):

I can confirm that this ran against my setup with the portable version. This does seem to be a bit of a security issue

<!-- gh-comment-id:2068264873 --> @MatissesProjects commented on GitHub (Apr 21, 2024): I can confirm that this ran against my setup with the portable version. This does seem to be a bit of a security issue
Author
Owner

@ltdrdata commented on GitHub (Apr 22, 2024):

Oh... That's right. I need to patch this.

<!-- gh-comment-id:2068286031 --> @ltdrdata commented on GitHub (Apr 22, 2024): Oh... That's right. I need to patch this.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/ComfyUI-Manager#272
No description provided.