security patch

https://github.com/ltdrdata/ComfyUI-Manager/issues/1125
This commit is contained in:
Dr.Lt.Data 2024-10-08 19:11:22 +09:00
parent 8dd84bb0ec
commit 3315807a37
3 changed files with 10 additions and 3 deletions

View File

@ -23,7 +23,7 @@ sys.path.append(glob_path)
import cm_global
from manager_util import *
version = [2, 51, 5]
version = [2, 51, 6]
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')

View File

@ -820,7 +820,14 @@ async def install_custom_node(request):
res = unzip_install(json_data['files'])
if install_type == "copy":
js_path_name = json_data['js_path'] if 'js_path' in json_data else '.'
if 'js_path' in json_data:
if '.' in json_data['js_path'] or ':' in json_data['js_path'] or json_data['js_path'].startswith('/'):
print(f"[ComfyUI Manager] An abnormal JS path has been transmitted. This could be the result of a security attack.\n{json_data['js_path']}")
return web.Response(status=400)
else:
js_path_name = json_data['js_path']
else:
js_path_name = '.'
res = copy_install(json_data['files'], js_path_name)
elif install_type == "git-clone":

View File

@ -1,7 +1,7 @@
[project]
name = "comfyui-manager"
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
version = "2.51.5"
version = "2.51.6"
license = { file = "LICENSE.txt" }
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions"]