subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
if not (repo_path / "pytest.ini").exists() and not (repo_path / "pyproject.toml").exists(): return {"passed": False, "tests_run": 0, "failures": 0, "output": "no test config"} try: result = subprocess.run( ["python3", "-m", "pytest", "--tb=short", "-q"], cwd=str(repo_path), capture_output=True,- Confidence
- 89% confidence
- Finding
- This code executes the repository's test suite with pytest, which will run arbitrary code from the analyzed repository in the local environment. In an agent skill that may inspect untrusted repositories, this creates a command-execution boundary crossing: attacker-controlled test files, fixtures, plugins, or import side effects can execute during analysis.
