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.pyis vulnerable to shell command injection. It constructs a command string by interpolating the--envargument and then executes it usingsubprocess.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 variableenvfromargs.envis placed directly into a list that is then joined and executed viasubprocess.run(cmd, shell=True). - [COMMAND_EXECUTION]: The script
scripts/coverage_check.pyutilizessubprocess.run(shell=True)in itsrun_commandhelper function. While current usage involves mostly static strings, the reliance onshell=Trueincreases the risk of accidental command injection during future development or if more dynamic parameters are added. - Evidence: The
run_commandfunction inscripts/coverage_check.pyexplicitly setsshell=Truefor executing coverage reports and generation commands. - [COMMAND_EXECUTION]: Conversely,
scripts/with_server.pyimplements strong security practices by usingshell=Falseandshlex.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.pyincludes aparse_command_safelyfunction that explicitly blocks shell operators and usessubprocess.Popenwithout a shell environment.
Audit Metadata