mirror of
https://github.com/hanzoui/custom-nodes-security-scan.git
synced 2026-10-30 20:56:54 +00:00
658 lines
23 KiB
HTML
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("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
|
|
</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("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
|
|
</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("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
|
|
</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("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
|
|
</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("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")
|
|
</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 == "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
|
|
</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 == "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
|
|
</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("git stash")
|
|
296 if ec == 0:
|
|
297 ec = os.system("git switch -C dev origin/dev")
|
|
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("git stash")
|
|
296 if ec == 0:
|
|
297 ec = os.system("git switch -C dev origin/dev")
|
|
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 == "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
|
|
</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 == "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
|
|
</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("git stash")
|
|
305 if ec == 0:
|
|
306 ec = os.system("git switch -C main origin/main")
|
|
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("git stash")
|
|
305 if ec == 0:
|
|
306 ec = os.system("git switch -C main origin/main")
|
|
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["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")
|
|
</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 = "temp"
|
|
46 self.prefix_append = "_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for _ in range(5))
|
|
47
|
|
48 @classmethod
|
|
49 def INPUT_TYPES(cls):
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|