Summary
Replace all usages of yaml.load(..., yaml.Loader) with yaml.safe_load() to avoid potential arbitrary code execution when parsing user-supplied config files.
Affected locations
numbast/src/numbast/tools/static_binding_generator.py — at least 2 call sites (including _cfg_path_uses_mlir_backend and Config.from_yaml_path)
numbast/src/numbast/experimental/mlir/tools/static_binding_generator.py — at least 2 call sites
Suggested fix
Replace each occurrence:
# Before
config_dict = yaml.load(f, yaml.Loader)
# After
config_dict = yaml.safe_load(f)
yaml.safe_load() is already used elsewhere in the codebase (e.g., in the YAML schema/docs tests), so this is a straightforward consistency fix.
References
Summary
Replace all usages of
yaml.load(..., yaml.Loader)withyaml.safe_load()to avoid potential arbitrary code execution when parsing user-supplied config files.Affected locations
numbast/src/numbast/tools/static_binding_generator.py— at least 2 call sites (including_cfg_path_uses_mlir_backendandConfig.from_yaml_path)numbast/src/numbast/experimental/mlir/tools/static_binding_generator.py— at least 2 call sitesSuggested fix
Replace each occurrence:
yaml.safe_load()is already used elsewhere in the codebase (e.g., in the YAML schema/docs tests), so this is a straightforward consistency fix.References