test-driven-development

Warn

Audited by Gen Agent Trust Hub on Apr 9, 2026

Risk Level: MEDIUMCOMMAND_EXECUTION
Full Analysis
  • [COMMAND_EXECUTION]: The script scripts/run_tests.py is vulnerable to shell command injection. It constructs a command string by interpolating the --env argument and then executes it using subprocess.run(shell=True). An attacker who can influence the command-line arguments (e.g., via a malicious configuration or by tricking the agent) could execute arbitrary commands by injecting shell operators into the environment name.
  • Evidence: In scripts/run_tests.py, the variable env from args.env is placed directly into a list that is then joined and executed via subprocess.run(cmd, shell=True).
  • [COMMAND_EXECUTION]: The script scripts/coverage_check.py utilizes subprocess.run(shell=True) in its run_command helper function. While current usage involves mostly static strings, the reliance on shell=True increases the risk of accidental command injection during future development or if more dynamic parameters are added.
  • Evidence: The run_command function in scripts/coverage_check.py explicitly sets shell=True for executing coverage reports and generation commands.
  • [COMMAND_EXECUTION]: Conversely, scripts/with_server.py implements strong security practices by using shell=False and shlex.split() for command parsing. It specifically checks for and rejects shell operators (e.g., &&, ||, |, ;), demonstrating an awareness of the risks present in the other scripts.
  • Evidence: scripts/with_server.py includes a parse_command_safely function that explicitly blocks shell operators and uses subprocess.Popen without a shell environment.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Apr 9, 2026, 06:28 PM