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 as part of verification (`python <file> self-test`). In a CI or reviewer environment, an untrusted skill author can place malicious code in a `.py` file that performs harmful actions before or instead of handling the `self-test` argument, leading to arbitrary code execution on the host.
