subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def has_self_test(fp): r = subprocess.run([sys.executable, fp, "self-test"], capture_output=True, text=True, timeout=30) return r.returncode == 0 and "PASS" in r.stdout- Confidence
- 98% confidence
- Finding
- This function executes an arbitrary Python file from the target product directory (`fp`) as part of verification. In a CI context, running untrusted repository code during validation can lead to arbitrary code execution, secret exfiltration, filesystem tampering, or lateral movement, even though `subprocess.run` is invoked without a shell.
