subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
output_file = Path(tmpdir) / "ai_output.txt" output_file.write_text(output, encoding="utf-8") result = subprocess.run( ["python3", "-m", "pytest", str(test_path), "-v", "--tb=short", f"--rootdir={tmpdir}"], capture_output=True,- Confidence
- 88% confidence
- Finding
- This code executes pytest in a subprocess against a test file selected from task data. Although it includes path-traversal checks, it still intentionally runs Python test code, and pytest test logic can execute arbitrary code during collection or execution. In the context of an evaluation skill, this makes task configuration and fixture contents a code-execution boundary, so compromise of test assets or untrusted task definitions can lead to arbitrary local execution.
