Files

658 lines
23 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>
Bandit Report
</title>
<style>
html * {
font-family: "Arial", sans-serif;
}
pre {
font-family: "Monaco", monospace;
}
.bordered-box {
border: 1px solid black;
padding-top:.5em;
padding-bottom:.5em;
padding-left:1em;
}
.metrics-box {
font-size: 1.1em;
line-height: 130%;
}
.metrics-title {
font-size: 1.5em;
font-weight: 500;
margin-bottom: .25em;
}
.issue-description {
font-size: 1.3em;
font-weight: 500;
}
.candidate-issues {
margin-left: 2em;
border-left: solid 1px; LightGray;
padding-left: 5%;
margin-top: .2em;
margin-bottom: .2em;
}
.issue-block {
border: 1px solid LightGray;
padding-left: .5em;
padding-top: .5em;
padding-bottom: .5em;
margin-bottom: .5em;
}
.issue-sev-high {
background-color: Pink;
}
.issue-sev-medium {
background-color: NavajoWhite;
}
.issue-sev-low {
background-color: LightCyan;
}
</style>
</head>
<body>
<div id="metrics">
<div class="metrics-box bordered-box">
<div class="metrics-title">
Metrics:<br>
</div>
Total lines of code: <span id="loc">9292</span><br>
Total lines skipped (#nosec): <span id="nosec">0</span>
</div>
</div>
<br>
<div id="results">
<div id="issue-0">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>240<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
236 # -----==========-----
237
238 def check_git():
239 print(&quot;Checking git version&quot;)
240 ec = os.system(&quot;git --version&quot;)
241 if ec != 0:
242 print(&quot;Please make sure git is installed on your system&quot;)
243 return False
</pre>
</div>
</div>
</div>
<div id="issue-1">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>240<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
236 # -----==========-----
237
238 def check_git():
239 print(&quot;Checking git version&quot;)
240 ec = os.system(&quot;git --version&quot;)
241 if ec != 0:
242 print(&quot;Please make sure git is installed on your system&quot;)
243 return False
</pre>
</div>
</div>
</div>
<div id="issue-2">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>267<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
263 if ext_path_exists:
264 os.chdir(ext_path)
265
266 print(&quot;Fetching latest commits from the git repository&quot;)
267 ec = os.system(&quot;git fetch --all&quot;)
268 if ec != 0:
269 print(&quot;The command &#x27;git fetch&#x27; failed, please restart the install script to try again&quot;)
270 return False
</pre>
</div>
</div>
</div>
<div id="issue-3">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>267<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
263 if ext_path_exists:
264 os.chdir(ext_path)
265
266 print(&quot;Fetching latest commits from the git repository&quot;)
267 ec = os.system(&quot;git fetch --all&quot;)
268 if ec != 0:
269 print(&quot;The command &#x27;git fetch&#x27; failed, please restart the install script to try again&quot;)
270 return False
</pre>
</div>
</div>
</div>
<div id="issue-4">
<div class="issue-block issue-sev-high">
<b>start_process_with_a_shell: </b> Starting a process with a shell, possible injection detected, security issue.<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>HIGH<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>278<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
274 else:
275 os.chdir(extensions_folder)
276
277 print(&quot;Cloning SeargeSDXL from the git repository&quot;)
278 ec = os.system(f&quot;git clone {SEARGE_SDXL_GIT_URL}&quot;)
279 if ec != 0:
280 print(f&quot;The command &#x27;git clone&#x27; failed, please delete the directory {ext_path} and &quot;
281 &quot;restart the install script to try again&quot;)
</pre>
</div>
</div>
</div>
<div id="issue-5">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>295<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
291
292 if inp == &quot;t&quot;:
293 os.chdir(ext_path)
294
295 ec = os.system(&quot;git stash&quot;)
296 if ec == 0:
297 ec = os.system(&quot;git switch -C dev origin/dev&quot;)
298
</pre>
</div>
</div>
</div>
<div id="issue-6">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>295<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
291
292 if inp == &quot;t&quot;:
293 os.chdir(ext_path)
294
295 ec = os.system(&quot;git stash&quot;)
296 if ec == 0:
297 ec = os.system(&quot;git switch -C dev origin/dev&quot;)
298
</pre>
</div>
</div>
</div>
<div id="issue-7">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>297<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
293 os.chdir(ext_path)
294
295 ec = os.system(&quot;git stash&quot;)
296 if ec == 0:
297 ec = os.system(&quot;git switch -C dev origin/dev&quot;)
298
299 os.chdir(old_cwd)
300
</pre>
</div>
</div>
</div>
<div id="issue-8">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>297<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
293 os.chdir(ext_path)
294
295 ec = os.system(&quot;git stash&quot;)
296 if ec == 0:
297 ec = os.system(&quot;git switch -C dev origin/dev&quot;)
298
299 os.chdir(old_cwd)
300
</pre>
</div>
</div>
</div>
<div id="issue-9">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>304<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
300
301 elif inp == &quot;r&quot;:
302 os.chdir(ext_path)
303
304 ec = os.system(&quot;git stash&quot;)
305 if ec == 0:
306 ec = os.system(&quot;git switch -C main origin/main&quot;)
307
</pre>
</div>
</div>
</div>
<div id="issue-10">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>304<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
300
301 elif inp == &quot;r&quot;:
302 os.chdir(ext_path)
303
304 ec = os.system(&quot;git stash&quot;)
305 if ec == 0:
306 ec = os.system(&quot;git switch -C main origin/main&quot;)
307
</pre>
</div>
</div>
</div>
<div id="issue-11">
<div class="issue-block issue-sev-low">
<b>start_process_with_a_shell: </b> Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell<br>
<b>Test ID:</b> B605<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>306<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b605_start_process_with_a_shell.html</a><br>
<div class="code">
<pre>
302 os.chdir(ext_path)
303
304 ec = os.system(&quot;git stash&quot;)
305 if ec == 0:
306 ec = os.system(&quot;git switch -C main origin/main&quot;)
307
308 os.chdir(old_cwd)
309
</pre>
</div>
</div>
</div>
<div id="issue-12">
<div class="issue-block issue-sev-low">
<b>start_process_with_partial_path: </b> Starting a process with a partial executable path<br>
<b>Test ID:</b> B607<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/78.html" target="_blank">CWE-78</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>306<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b607_start_process_with_partial_path.html</a><br>
<div class="code">
<pre>
302 os.chdir(ext_path)
303
304 ec = os.system(&quot;git stash&quot;)
305 if ec == 0:
306 ec = os.system(&quot;git switch -C main origin/main&quot;)
307
308 os.chdir(old_cwd)
309
</pre>
</div>
</div>
</div>
<div id="issue-13">
<div class="issue-block issue-sev-medium">
<b>blacklist: </b> Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.<br>
<b>Test ID:</b> B310<br>
<b>Severity: </b>MEDIUM<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/22.html" target="_blank">CWE-22</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py" target="_blank">/custom_nodes/SeargeSDXL/installer/SeargeSDXL-Installer.py</a><br>
<b>Line number: </b>447<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b310-urllib-urlopen" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b310-urllib-urlopen</a><br>
<div class="code">
<pre>
443 counter[&quot;last&quot;] = mb
444 print(f&quot;Transferred {mb} MB / {tmb} MB&quot;)
445
446 try:
447 request.urlretrieve(dl_url, full_path, progress)
448
449 except ContentTooShortError:
450 print(&quot;Download incomplete&quot;)
</pre>
</div>
</div>
</div>
<div id="issue-14">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/modules/controlnet/hed/__init__.py" target="_blank">/custom_nodes/SeargeSDXL/modules/controlnet/hed/__init__.py</a><br>
<b>Line number: </b>88<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
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)
</pre>
</div>
</div>
</div>
<div id="issue-15">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/modules/controlnet/leres/__init__.py" target="_blank">/custom_nodes/SeargeSDXL/modules/controlnet/leres/__init__.py</a><br>
<b>Line number: </b>47<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
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():
</pre>
</div>
</div>
</div>
<div id="issue-16">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/modules/controlnet/utils.py" target="_blank">/custom_nodes/SeargeSDXL/modules/controlnet/utils.py</a><br>
<b>Line number: </b>23<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
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]
</pre>
</div>
</div>
</div>
<div id="issue-17">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/modules/controlnet/utils.py" target="_blank">/custom_nodes/SeargeSDXL/modules/controlnet/utils.py</a><br>
<b>Line number: </b>27<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
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
</pre>
</div>
</div>
</div>
<div id="issue-18">
<div class="issue-block issue-sev-low">
<b>assert_used: </b> Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.<br>
<b>Test ID:</b> B101<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/703.html" target="_blank">CWE-703</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/modules/controlnet/utils.py" target="_blank">/custom_nodes/SeargeSDXL/modules/controlnet/utils.py</a><br>
<b>Line number: </b>30<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html" target="_blank">https://bandit.readthedocs.io/en/1.7.9/plugins/b101_assert_used.html</a><br>
<div class="code">
<pre>
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
</pre>
</div>
</div>
</div>
<div id="issue-19">
<div class="issue-block issue-sev-low">
<b>blacklist: </b> Standard pseudo-random generators are not suitable for security/cryptographic purposes.<br>
<b>Test ID:</b> B311<br>
<b>Severity: </b>LOW<br>
<b>Confidence: </b>HIGH<br>
<b>CWE: </b><a href="https://cwe.mitre.org/data/definitions/330.html" target="_blank">CWE-330</a><br>
<b>File: </b><a href="/custom_nodes/SeargeSDXL/modules/ui_preview_image.py" target="_blank">/custom_nodes/SeargeSDXL/modules/ui_preview_image.py</a><br>
<b>Line number: </b>46<br>
<b>More info: </b><a href="https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random" target="_blank">https://bandit.readthedocs.io/en/1.7.9/blacklists/blacklist_calls.html#b311-random</a><br>
<div class="code">
<pre>
42 def __init__(self):
43 super().__init__()
44 self.output_dir = folder_paths.get_temp_directory()
45 self.type = &quot;temp&quot;
46 self.prefix_append = &quot;_temp_&quot; + &#x27;&#x27;.join(random.choice(&quot;abcdefghijklmnopqrstupvxyz&quot;) for _ in range(5))
47
48 @classmethod
49 def INPUT_TYPES(cls):
</pre>
</div>
</div>
</div>
</div>
</body>
</html>