Skip to content

Conversation

@yoland68
Copy link
Member

You can call comfy node validate before deciding to publish

@yoland68
Copy link
Member Author

Tested with ADE and reactor:

(comfy-cli-test-uv) ➜  ComfyUI-AnimateDiff-Evolved git:(main) comfy node validate
Validating node configuration...
Running security checks...
✓ All validation checks passed successfully
(comfy-cli-test-uv) ➜  ComfyUI-AnimateDiff-Evolved git:(main) z reactor          
(comfy-cli-test-uv) ➜  comfyui-reactor-node git:(main) comfy node validate
Validating node configuration...
Running security checks...
Security warnings found:
r_basicsr/utils/options.py:77:16: S307 Use of possibly insecure function; consider using `ast.literal_eval`
   |
75 |     # list
76 |     if value.startswith('['):
77 |         return eval(value)
   |                ^^^^^^^^^^^ S307
78 |     # str
79 |     return value
   |

r_basicsr/utils/options.py:128:13: S102 Use of `exec` detected
    |
126 |             eval_str += '=value'
127 |             # using exec function
128 |             exec(eval_str)
    |             ^^^^ S102
129 | 
130 |     opt['auto_resume'] = args.auto_resume
    |

r_facelib/detection/yolov5face/models/yolo.py:188:13: S307 Use of possibly insecure function; consider using `ast.literal_eval`
    |
186 |     layers, save, c2 = [], [], ch[-1]  # layers, savelist, ch out
187 |     for i, (f, n, m, args) in enumerate(d["backbone"] + d["head"]):  # from, number, module, args
188 |         m = eval(m) if isinstance(m, str) else m  # eval strings
    |             ^^^^^^^ S307
189 |         for j, a in enumerate(args):
190 |             try:
    |

r_facelib/detection/yolov5face/models/yolo.py:191:27: S307 Use of possibly insecure function; consider using `ast.literal_eval`
    |
189 |         for j, a in enumerate(args):
190 |             try:
191 |                 args = eval(a) if isinstance(a, str) else a  # eval strings
    |                           ^^^^^^^ S307
192 |             except:
193 |                 pass
    |

scripts/r_masking/core.py:110:15: S307 Use of possibly insecure function; consider using `ast.literal_eval`
    |
108 |     }
109 |     code = f'lambda _cls, {arg_list}: _tuple_new(_cls, ({arg_list}))'
110 |     __new__ = eval(code, namespace)
    |               ^^^^^^^^^^^^^^^^^^^^^ S307
111 |     __new__.__name__ = '__new__'
112 |     __new__.__doc__ = f'Create new instance of {typename}({arg_list})'
    |


We will soon disable exec and eval, so this will be an error soon.
✓ All validation checks passed successfully

@yoland68 yoland68 merged commit 3f0cf4f into main Dec 21, 2024
10 of 12 checks passed
@yoland68 yoland68 deleted the yo-add-rule-check branch December 21, 2024 23:00
@codecov
Copy link

codecov bot commented Dec 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants