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 code executes an arbitrary Python file from the target product folder as part of verification by calling `<python> <file> self-test`. Any untrusted skill can place malicious top-level code or a crafted self-test handler in that file, resulting in arbitrary code execution on the CI runner or analyst machine. In this context, the issue is not shell injection but unsafe execution of untrusted repository code.
