Dynamic attribute access via getattr()
Low
- Category
- Dangerous Code Execution
- Content
vt_symbols = [s for s in vt_symbols if s not in _bad] p(f" [warn] 已过滤{len(_bad)}个不支持的标的,剩余{len(vt_symbols)}个") mod = importlib.import_module(args.strategy) if hasattr(mod, args.cls): strategy_cls = getattr(mod, args.cls) else: # 大小写模糊匹配(agent常把Ma写成MA) low = args.cls.lower(); hit = [n for n in dir(mod) if n.lower() == low] if hit: p(f" [warn] 类名修正: {args.cls} -> {hit[0]}"); strategy_cls = getattr(mod, hit[0])- Confidence
- 86% confidence
- Finding
- if hasattr(mod, args.cls): strategy_cls = getattr(mod, args.cls)
