os.system() or os exec-family call
High
- Category
- Dangerous Code Execution
- Content
# 1. 初始化 print("【1】初始化空间...") os.system(f'./memory_optimizer.py init --agent {agent_id}') # 2. 生成中期总结(使用模拟数据) print("\n【2】生成中期总结...")- Confidence
- 94% confidence
- Finding
- The test workflow builds a shell command with an f-string and passes attacker-controlled input (`agent_id` from CLI) to `os.system`. If a user supplies shell metacharacters in `--agent`, this can trigger arbitrary command execution in the caller's environment. In a memory-management tool, shell execution is not necessary for this operation, which increases the risk profile.
