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
- 97% confidence
- Finding
- This helper executes an arbitrary Python file from the target product directory to probe for a self-test command. In a CI or verification context, that means untrusted repository content is executed merely to validate it, creating a direct remote code execution path if an attacker can submit or influence the checked folder.
