Dynamic attribute access via getattr()
Low
- Category
- Dangerous Code Execution
- Content
try: # 引入模块 module = importlib.import_module(module_path) skill_class = getattr(module, class_name) skill_instance = skill_class() # 实例化技能 # 存入缓存- Confidence
- 91% confidence
- Finding
- The loader dynamically imports a module and then resolves a class name via getattr() using externally supplied identifiers. If skill metadata is attacker-controlled or insufficiently validated, this can instantiate unintended classes and execute arbitrary import-time or constructor-side code, which is especially dangerous in a central dispatcher that must load many skills automatically.
