Files
custom-nodes-security-scan/docs/ComfyUI_Comfyroll_CustomNodes-bandit.html
zeekay 84ca3e48e7 fix: repair broken identifiers from rebrand
Fix Python/JS identifiers that had spaces inserted by the
ComfyUI → Hanzo Studio replacement (e.g. class names, variable
prefixes). Spaces in identifiers cause syntax errors.
2026-02-23 14:50:04 -08:00

994 lines
41 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">9879</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>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/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py</a><br>
<b>Line number: </b>423<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>
419
420
421 def reduce_opacity(img, opacity):
422 &quot;&quot;&quot;Returns an image with reduced opacity.&quot;&quot;&quot;
423 assert opacity &gt;= 0 and opacity &lt;= 1
424 if img.mode != &#x27;RGBA&#x27;:
425 img = img.convert(&#x27;RGBA&#x27;)
426 else:
</pre>
</div>
</div>
</div>
<div id="issue-1">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py</a><br>
<b>Line number: </b>436<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>
432
433
434 def random_hex_color():
435 # Generate three random values for RGB
436 r = random.randint(0, 255)
437 g = random.randint(0, 255)
438 b = random.randint(0, 255)
439
</pre>
</div>
</div>
</div>
<div id="issue-2">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py</a><br>
<b>Line number: </b>437<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>
433
434 def random_hex_color():
435 # Generate three random values for RGB
436 r = random.randint(0, 255)
437 g = random.randint(0, 255)
438 b = random.randint(0, 255)
439
440 # Convert RGB to hex format
</pre>
</div>
</div>
</div>
<div id="issue-3">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py</a><br>
<b>Line number: </b>438<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>
434 def random_hex_color():
435 # Generate three random values for RGB
436 r = random.randint(0, 255)
437 g = random.randint(0, 255)
438 b = random.randint(0, 255)
439
440 # Convert RGB to hex format
441 hex_color = &quot;#{:02x}{:02x}{:02x}&quot;.format(r, g, b)
</pre>
</div>
</div>
</div>
<div id="issue-4">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py</a><br>
<b>Line number: </b>448<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>
444
445
446 def random_rgb():
447 # Generate three random values for RGB
448 r = random.randint(0, 255)
449 g = random.randint(0, 255)
450 b = random.randint(0, 255)
451
</pre>
</div>
</div>
</div>
<div id="issue-5">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py</a><br>
<b>Line number: </b>449<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>
445
446 def random_rgb():
447 # Generate three random values for RGB
448 r = random.randint(0, 255)
449 g = random.randint(0, 255)
450 b = random.randint(0, 255)
451
452 # Format RGB as a string in the format &quot;128,128,128&quot;
</pre>
</div>
</div>
</div>
<div id="issue-6">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/functions_graphics.py</a><br>
<b>Line number: </b>450<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>
446 def random_rgb():
447 # Generate three random values for RGB
448 r = random.randint(0, 255)
449 g = random.randint(0, 255)
450 b = random.randint(0, 255)
451
452 # Format RGB as a string in the format &quot;128,128,128&quot;
453 rgb_string = &quot;{},{},{}&quot;.format(r, g, b)
</pre>
</div>
</div>
</div>
<div id="issue-7">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py</a><br>
<b>Line number: </b>141<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>
137 # Draw grid based on the binary pattern
138 for row_index, row in enumerate(grid):
139 for col_index, bit in enumerate(row):
140 if jitter_distance != 0:
141 x_jitter = random.uniform(0, jitter_distance)
142 y_jitter = random.uniform(0, jitter_distance)
143 x1 = col_index * square_width + x_jitter
144 y1 = row_index * square_height + y_jitter
</pre>
</div>
</div>
</div>
<div id="issue-8">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py</a><br>
<b>Line number: </b>142<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>
138 for row_index, row in enumerate(grid):
139 for col_index, bit in enumerate(row):
140 if jitter_distance != 0:
141 x_jitter = random.uniform(0, jitter_distance)
142 y_jitter = random.uniform(0, jitter_distance)
143 x1 = col_index * square_width + x_jitter
144 y1 = row_index * square_height + y_jitter
145 x2 = x1 + square_width + x_jitter
</pre>
</div>
</div>
</div>
<div id="issue-9">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py</a><br>
<b>Line number: </b>152<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>
148 # Draw black square if bit is 1, else draw white square
149 #color = color1 if bit == 1 else color0
150
151 # Adjust color based on bias
152 if random.uniform(0, 1) &lt; abs(bias):
153 color = color1
154 else:
155 color = color0
</pre>
</div>
</div>
</div>
<div id="issue-10">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py</a><br>
<b>Line number: </b>452<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>
448 ]
449
450 for row in range(num_rows):
451 for col in range(num_cols):
452 shape_function = random.choice(shape_functions)
453 color = random.choice([color1, color2])
454 size = random.uniform(20, min(width, height) / 2)
455 aspect_ratio = random.uniform(0.5, 2.0) # For shapes that use aspect ratio
</pre>
</div>
</div>
</div>
<div id="issue-11">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py</a><br>
<b>Line number: </b>453<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>
449
450 for row in range(num_rows):
451 for col in range(num_cols):
452 shape_function = random.choice(shape_functions)
453 color = random.choice([color1, color2])
454 size = random.uniform(20, min(width, height) / 2)
455 aspect_ratio = random.uniform(0.5, 2.0) # For shapes that use aspect ratio
456
</pre>
</div>
</div>
</div>
<div id="issue-12">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py</a><br>
<b>Line number: </b>454<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>
450 for row in range(num_rows):
451 for col in range(num_cols):
452 shape_function = random.choice(shape_functions)
453 color = random.choice([color1, color2])
454 size = random.uniform(20, min(width, height) / 2)
455 aspect_ratio = random.uniform(0.5, 2.0) # For shapes that use aspect ratio
456
457 center_x = col * (width / num_cols) + (width / num_cols) / 2
</pre>
</div>
</div>
</div>
<div id="issue-13">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_graphics_pattern.py</a><br>
<b>Line number: </b>455<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>
451 for col in range(num_cols):
452 shape_function = random.choice(shape_functions)
453 color = random.choice([color1, color2])
454 size = random.uniform(20, min(width, height) / 2)
455 aspect_ratio = random.uniform(0.5, 2.0) # For shapes that use aspect ratio
456
457 center_x = col * (width / num_cols) + (width / num_cols) / 2
458 center_y = row * (height / num_rows) + (height / num_rows) / 2
</pre>
</div>
</div>
</div>
<div id="issue-14">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_lora.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_lora.py</a><br>
<b>Line number: </b>220<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>
216 else:
217 CR_RandomWeightLoRA.StridesMap[id_hash] = 0
218
219 last_weight = CR_RandomWeightLoRA.LastWeightMap.get(id_hash, None)
220 weight = uniform(weight_min, weight_max)
221
222 if last_weight is not None:
223 while weight == last_weight:
</pre>
</div>
</div>
</div>
<div id="issue-15">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_lora.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_lora.py</a><br>
<b>Line number: </b>224<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>
220 weight = uniform(weight_min, weight_max)
221
222 if last_weight is not None:
223 while weight == last_weight:
224 weight = uniform(weight_min, weight_max)
225
226 CR_RandomWeightLoRA.LastWeightMap[id_hash] = weight
227
</pre>
</div>
</div>
</div>
<div id="issue-16">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_lora.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_lora.py</a><br>
<b>Line number: </b>359<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>
355
356 def perform_randomization() -&gt; set:
357 _lora_set = set()
358
359 rand_1 = random()
360 rand_2 = random()
361 rand_3 = random()
362
</pre>
</div>
</div>
</div>
<div id="issue-17">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_lora.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_lora.py</a><br>
<b>Line number: </b>360<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>
356 def perform_randomization() -&gt; set:
357 _lora_set = set()
358
359 rand_1 = random()
360 rand_2 = random()
361 rand_3 = random()
362
363 apply_1 = True if (rand_1 &lt;= chance_1 and switch_1 == &quot;On&quot;) else False
</pre>
</div>
</div>
</div>
<div id="issue-18">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_lora.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_lora.py</a><br>
<b>Line number: </b>361<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>
357 _lora_set = set()
358
359 rand_1 = random()
360 rand_2 = random()
361 rand_3 = random()
362
363 apply_1 = True if (rand_1 &lt;= chance_1 and switch_1 == &quot;On&quot;) else False
364 apply_2 = True if (rand_2 &lt;= chance_2 and switch_2 == &quot;On&quot;) else False
</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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>131<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>
127 choice_str = custom_values
128 else:
129 pass
130
131 multiline_text = &#x27;\n&#x27;.join([prepend_text + &#x27;&#x27;.join(random.choice(choice_str) for _ in range(string_length)) for _ in range(rows)])
132
133 return (multiline_text, show_help, )
134
</pre>
</div>
</div>
</div>
<div id="issue-20">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>169<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>
165 if value_type == &quot;hex color&quot;:
166 choice_str = &#x27;0123456789ABCDEF&#x27;
167
168 if value_type == &quot;hex color&quot;:
169 multiline_text = &#x27;\n&#x27;.join([&#x27;#&#x27; + &#x27;&#x27;.join(random.choice(choice_str) for _ in range(6)) for _ in range(rows)])
170 elif value_type == &quot;rgb&quot;:
171 multiline_text = &#x27;\n&#x27;.join([f&#x27;{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}&#x27; for _ in range(rows)])
172 elif value_type == &quot;matplotlib xkcd&quot;:
</pre>
</div>
</div>
</div>
<div id="issue-21">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>171<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>
167
168 if value_type == &quot;hex color&quot;:
169 multiline_text = &#x27;\n&#x27;.join([&#x27;#&#x27; + &#x27;&#x27;.join(random.choice(choice_str) for _ in range(6)) for _ in range(rows)])
170 elif value_type == &quot;rgb&quot;:
171 multiline_text = &#x27;\n&#x27;.join([f&#x27;{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}&#x27; for _ in range(rows)])
172 elif value_type == &quot;matplotlib xkcd&quot;:
173 multiline_text = &#x27;\n&#x27;.join([random.choice(list(xkcd_colors.keys())).replace(&#x27;xkcd:&#x27;, &#x27;&#x27;) for _ in range(rows)])
174 else:
</pre>
</div>
</div>
</div>
<div id="issue-22">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>171<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>
167
168 if value_type == &quot;hex color&quot;:
169 multiline_text = &#x27;\n&#x27;.join([&#x27;#&#x27; + &#x27;&#x27;.join(random.choice(choice_str) for _ in range(6)) for _ in range(rows)])
170 elif value_type == &quot;rgb&quot;:
171 multiline_text = &#x27;\n&#x27;.join([f&#x27;{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}&#x27; for _ in range(rows)])
172 elif value_type == &quot;matplotlib xkcd&quot;:
173 multiline_text = &#x27;\n&#x27;.join([random.choice(list(xkcd_colors.keys())).replace(&#x27;xkcd:&#x27;, &#x27;&#x27;) for _ in range(rows)])
174 else:
</pre>
</div>
</div>
</div>
<div id="issue-23">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>171<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>
167
168 if value_type == &quot;hex color&quot;:
169 multiline_text = &#x27;\n&#x27;.join([&#x27;#&#x27; + &#x27;&#x27;.join(random.choice(choice_str) for _ in range(6)) for _ in range(rows)])
170 elif value_type == &quot;rgb&quot;:
171 multiline_text = &#x27;\n&#x27;.join([f&#x27;{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}&#x27; for _ in range(rows)])
172 elif value_type == &quot;matplotlib xkcd&quot;:
173 multiline_text = &#x27;\n&#x27;.join([random.choice(list(xkcd_colors.keys())).replace(&#x27;xkcd:&#x27;, &#x27;&#x27;) for _ in range(rows)])
174 else:
</pre>
</div>
</div>
</div>
<div id="issue-24">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>173<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>
169 multiline_text = &#x27;\n&#x27;.join([&#x27;#&#x27; + &#x27;&#x27;.join(random.choice(choice_str) for _ in range(6)) for _ in range(rows)])
170 elif value_type == &quot;rgb&quot;:
171 multiline_text = &#x27;\n&#x27;.join([f&#x27;{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}&#x27; for _ in range(rows)])
172 elif value_type == &quot;matplotlib xkcd&quot;:
173 multiline_text = &#x27;\n&#x27;.join([random.choice(list(xkcd_colors.keys())).replace(&#x27;xkcd:&#x27;, &#x27;&#x27;) for _ in range(rows)])
174 else:
175 pass
176
</pre>
</div>
</div>
</div>
<div id="issue-25">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>205<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>
201
202 # Set the seed
203 random.seed(seed)
204
205 start_letter = random.choice(&#x27;HV&#x27;)
206 value_range = random.choice(values)
207
208 codes = []
</pre>
</div>
</div>
</div>
<div id="issue-26">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>206<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>
202 # Set the seed
203 random.seed(seed)
204
205 start_letter = random.choice(&#x27;HV&#x27;)
206 value_range = random.choice(values)
207
208 codes = []
209 for _ in range(rows):
</pre>
</div>
</div>
</div>
<div id="issue-27">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>211<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>
207
208 codes = []
209 for _ in range(rows):
210 # Generate a random number within the specified range
211 number = &#x27;&#x27;.join(random.choice(values) for _ in range(string_length))
212 # Append the code to the list
213 codes.append(f&quot;{start_letter}{number}&quot;)
214
</pre>
</div>
</div>
</div>
<div id="issue-28">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>249<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>
245 for i in range(1, rows + 1):
246 print(temp)
247 if temp &lt;= 99 - rows + i:
248 upper_bound = min(99, temp + (99 - temp) // (rows - i + 1))
249 current_value = random.randint(temp, upper_bound)
250 multiline_text += f&#x27;{current_value}:{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}\n&#x27;
251
252 temp = current_value + 1
</pre>
</div>
</div>
</div>
<div id="issue-29">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>250<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>
246 print(temp)
247 if temp &lt;= 99 - rows + i:
248 upper_bound = min(99, temp + (99 - temp) // (rows - i + 1))
249 current_value = random.randint(temp, upper_bound)
250 multiline_text += f&#x27;{current_value}:{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}\n&#x27;
251
252 temp = current_value + 1
253
</pre>
</div>
</div>
</div>
<div id="issue-30">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>250<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>
246 print(temp)
247 if temp &lt;= 99 - rows + i:
248 upper_bound = min(99, temp + (99 - temp) // (rows - i + 1))
249 current_value = random.randint(temp, upper_bound)
250 multiline_text += f&#x27;{current_value}:{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}\n&#x27;
251
252 temp = current_value + 1
253
</pre>
</div>
</div>
</div>
<div id="issue-31">
<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/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py" target="_blank">/custom_nodes/HanzoStudio_Comfyroll_CustomNodes/nodes/nodes_utils_random.py</a><br>
<b>Line number: </b>250<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>
246 print(temp)
247 if temp &lt;= 99 - rows + i:
248 upper_bound = min(99, temp + (99 - temp) // (rows - i + 1))
249 current_value = random.randint(temp, upper_bound)
250 multiline_text += f&#x27;{current_value}:{random.randint(0, 255)},{random.randint(0, 255)},{random.randint(0, 255)}\n&#x27;
251
252 temp = current_value + 1
253
</pre>
</div>
</div>
</div>
</div>
</body>
</html>