Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion autoforge/harness/run_goal.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from __future__ import annotations

import shlex
import subprocess
import sys
from pathlib import Path
Expand Down Expand Up @@ -126,7 +127,9 @@ def _goal_coverage(description: str, config: dict) -> None:
"""Run tests and report coverage."""
test_cmd = config.get("test", {}).get("command", "pytest -v")
print(f"Running: {test_cmd}")
result = subprocess.run(test_cmd, shell=True, timeout=300)
# Security: avoid shell=True to prevent shell injection from YAML config.
# Detected by Survey2Ship SecurityScanner (claim-0003 / arxiv:2604.07223)
result = subprocess.run(shlex.split(test_cmd), timeout=300)
if result.returncode == 0:
print("Tests passed.")
else:
Expand Down
Loading