From 4a1e76730a1f8e7d1e517abe6cd7bc6d1d091cae Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Thu, 24 Jul 2025 02:44:43 +0900 Subject: [PATCH] fixed: security_check - robust checking https://github.com/Comfy-Org/ComfyUI-Manager/issues/2002 --- glob/manager_core.py | 2 +- glob/security_check.py | 19 ++++++++++++------- pyproject.toml | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/glob/manager_core.py b/glob/manager_core.py index 1121bd08..238d3f62 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -43,7 +43,7 @@ import manager_downloader from node_package import InstalledNodePackage -version_code = [3, 34, 4] +version_code = [3, 34, 5] version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '') diff --git a/glob/security_check.py b/glob/security_check.py index a3477b05..892e96a2 100644 --- a/glob/security_check.py +++ b/glob/security_check.py @@ -73,13 +73,18 @@ https://blog.comfy.org/comfyui-statement-on-the-ultralytics-crypto-miner-situati detected = set() try: anthropic_info = subprocess.check_output(manager_util.make_pip_cmd(["show", "anthropic"]), text=True, stderr=subprocess.DEVNULL) - anthropic_reqs = [x for x in anthropic_info.split('\n') if x.startswith("Requires")][0].split(': ') - if anthropic_reqs and "pycrypto" in anthropic_reqs[1]: - location = [x for x in anthropic_info.split('\n') if x.startswith("Location")][0].split(': ')[1] - for fi in os.listdir(location): - if fi.startswith("anthropic"): - guide["ComfyUI_LLMVISION"] = f"\n0.Remove {os.path.join(location, fi)}" + guide["ComfyUI_LLMVISION"] - detected.add("ComfyUI_LLMVISION") + requires_lines = [x for x in anthropic_info.split('\n') if x.startswith("Requires")] + if requires_lines: + anthropic_reqs = requires_lines[0].split(": ", 1)[1] + if "pycrypto" in anthropic_reqs: + location_lines = [x for x in anthropic_info.split('\n') if x.startswith("Location")] + if location_lines: + location = location_lines[0].split(": ", 1)[1] + for fi in os.listdir(location): + if fi.startswith("anthropic"): + guide["ComfyUI_LLMVISION"] = (f"\n0.Remove {os.path.join(location, fi)}" + guide["ComfyUI_LLMVISION"]) + detected.add("ComfyUI_LLMVISION") + except subprocess.CalledProcessError: pass diff --git a/pyproject.toml b/pyproject.toml index a82542c5..1e7e6831 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "3.34.4" +version = "3.34.5" license = { file = "LICENSE.txt" } dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions", "toml", "uv", "chardet"]