exec() call detected
High
- Category
- Dangerous Code Execution
- Content
config_file = os.path.join(os.path.dirname(__file__), f'{args.config}_config.py') if os.path.exists(config_file): print(f'📋 加载配置: {args.config}_config.py\n') exec(open(config_file, encoding='utf-8').read(), globals()) else: print(f'⚠️ 配置文件不存在: {config_file}') print('⚠️ 跳过目录重命名和文件归档步骤\n')- Confidence
- 99% confidence
- Finding
- The script reads a Python file selected via the --config argument and executes it with exec(..., globals()), which allows arbitrary code execution in the context of the script. In a workspace-organizing skill, config loading should be declarative; executing code is far more dangerous because a malicious or tampered config can run any filesystem or OS command, especially when the user invokes the tool on valuable directories.
