mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2026-11-05 07:47:25 +00:00
[GH-ISSUE #594] [Exploit] Arbitrarty code execution possible on client machine from third party sites. #272
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/ComfyUI-Manager#272
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
@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
@ltdrdata commented on GitHub (Apr 22, 2024):
Oh... That's right. I need to patch this.