Metrics:
Total lines of code: 9292
Total lines skipped (#nosec): 0

start_process_with_a_shell: Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell
Test ID: B605
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 240
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html
236	# -----==========-----
237	
238	def check_git():
239	    print("Checking git version")
240	    ec = os.system("git --version")
241	    if ec != 0:
242	        print("Please make sure git is installed on your system")
243	        return False
start_process_with_partial_path: Starting a process with a partial executable path
Test ID: B607
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 240
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html
236	# -----==========-----
237	
238	def check_git():
239	    print("Checking git version")
240	    ec = os.system("git --version")
241	    if ec != 0:
242	        print("Please make sure git is installed on your system")
243	        return False
start_process_with_a_shell: Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell
Test ID: B605
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 267
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html
263	    if ext_path_exists:
264	        os.chdir(ext_path)
265	
266	        print("Fetching latest commits from the git repository")
267	        ec = os.system("git fetch --all")
268	        if ec != 0:
269	            print("The command 'git fetch' failed, please restart the install script to try again")
270	            return False
start_process_with_partial_path: Starting a process with a partial executable path
Test ID: B607
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 267
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html
263	    if ext_path_exists:
264	        os.chdir(ext_path)
265	
266	        print("Fetching latest commits from the git repository")
267	        ec = os.system("git fetch --all")
268	        if ec != 0:
269	            print("The command 'git fetch' failed, please restart the install script to try again")
270	            return False
start_process_with_a_shell: Starting a process with a shell, possible injection detected, security issue.
Test ID: B605
Severity: HIGH
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 278
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html
274	    else:
275	        os.chdir(extensions_folder)
276	
277	        print("Cloning SeargeSDXL from the git repository")
278	        ec = os.system(f"git clone {SEARGE_SDXL_GIT_URL}")
279	        if ec != 0:
280	            print(f"The command 'git clone' failed, please delete the directory {ext_path} and "
281	                  "restart the install script to try again")
start_process_with_a_shell: Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell
Test ID: B605
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 295
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html
291	
292	    if inp == "t":
293	        os.chdir(ext_path)
294	
295	        ec = os.system("git stash")
296	        if ec == 0:
297	            ec = os.system("git switch -C dev origin/dev")
298	
start_process_with_partial_path: Starting a process with a partial executable path
Test ID: B607
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 295
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html
291	
292	    if inp == "t":
293	        os.chdir(ext_path)
294	
295	        ec = os.system("git stash")
296	        if ec == 0:
297	            ec = os.system("git switch -C dev origin/dev")
298	
start_process_with_a_shell: Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell
Test ID: B605
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 297
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html
293	        os.chdir(ext_path)
294	
295	        ec = os.system("git stash")
296	        if ec == 0:
297	            ec = os.system("git switch -C dev origin/dev")
298	
299	        os.chdir(old_cwd)
300	
start_process_with_partial_path: Starting a process with a partial executable path
Test ID: B607
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 297
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html
293	        os.chdir(ext_path)
294	
295	        ec = os.system("git stash")
296	        if ec == 0:
297	            ec = os.system("git switch -C dev origin/dev")
298	
299	        os.chdir(old_cwd)
300	
start_process_with_a_shell: Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell
Test ID: B605
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 304
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html
300	
301	    elif inp == "r":
302	        os.chdir(ext_path)
303	
304	        ec = os.system("git stash")
305	        if ec == 0:
306	            ec = os.system("git switch -C main origin/main")
307	
start_process_with_partial_path: Starting a process with a partial executable path
Test ID: B607
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 304
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html
300	
301	    elif inp == "r":
302	        os.chdir(ext_path)
303	
304	        ec = os.system("git stash")
305	        if ec == 0:
306	            ec = os.system("git switch -C main origin/main")
307	
start_process_with_a_shell: Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell
Test ID: B605
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 306
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html
302	        os.chdir(ext_path)
303	
304	        ec = os.system("git stash")
305	        if ec == 0:
306	            ec = os.system("git switch -C main origin/main")
307	
308	        os.chdir(old_cwd)
309	
start_process_with_partial_path: Starting a process with a partial executable path
Test ID: B607
Severity: LOW
Confidence: HIGH
CWE: CWE-78
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 306
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html
302	        os.chdir(ext_path)
303	
304	        ec = os.system("git stash")
305	        if ec == 0:
306	            ec = os.system("git switch -C main origin/main")
307	
308	        os.chdir(old_cwd)
309	
blacklist: Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
Test ID: B310
Severity: MEDIUM
Confidence: HIGH
CWE: CWE-22
File: /custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py
Line number: 447
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b310-urllib-urlopen
443	            counter["last"] = mb
444	            print(f"Transferred {mb} MB / {tmb} MB")
445	
446	    try:
447	        request.urlretrieve(dl_url, full_path, progress)
448	
449	    except ContentTooShortError:
450	        print("Download incomplete")
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/SeargeSDXL/modules/controlnet/hed/__init__.py
Line number: 88
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
84	
85	        input_image = HWC3(input_image)
86	        input_image = resize_image(input_image, detect_resolution)
87	
88	        assert input_image.ndim == 3
89	        H, W, C = input_image.shape
90	        with torch.no_grad():
91	            image_hed = torch.from_numpy(input_image.copy()).float().to(device)
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/SeargeSDXL/modules/controlnet/leres/__init__.py
Line number: 47
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
43	        
44	        input_image = HWC3(input_image)
45	        input_image = resize_image(input_image, detect_resolution)
46	
47	        assert input_image.ndim == 3
48	        height, width, dim = input_image.shape
49	
50	        with torch.no_grad():
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/SeargeSDXL/modules/controlnet/utils.py
Line number: 23
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
19	    return torch.stack(out_list, dim=0)
20	
21	
22	def HWC3(x):
23	    assert x.dtype == np.uint8
24	
25	    if x.ndim == 2:
26	        x = x[:, :, None]
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/SeargeSDXL/modules/controlnet/utils.py
Line number: 27
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
23	    assert x.dtype == np.uint8
24	
25	    if x.ndim == 2:
26	        x = x[:, :, None]
27	    assert x.ndim == 3
28	
29	    H, W, C = x.shape
30	    assert C == 1 or C == 3 or C == 4
assert_used: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Test ID: B101
Severity: LOW
Confidence: HIGH
CWE: CWE-703
File: /custom_nodes/SeargeSDXL/modules/controlnet/utils.py
Line number: 30
More info: https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html
26	        x = x[:, :, None]
27	    assert x.ndim == 3
28	
29	    H, W, C = x.shape
30	    assert C == 1 or C == 3 or C == 4
31	
32	    if C == 3:
33	        return x
blacklist: Standard pseudo-random generators are not suitable for security/cryptographic purposes.
Test ID: B311
Severity: LOW
Confidence: HIGH
CWE: CWE-330
File: /custom_nodes/SeargeSDXL/modules/ui_preview_image.py
Line number: 46
More info: https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random
42	    def __init__(self):
43	        super().__init__()
44	        self.output_dir = folder_paths.get_temp_directory()
45	        self.type = "temp"
46	        self.prefix_append = "_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for _ in range(5))
47	
48	    @classmethod
49	    def INPUT_TYPES(cls):