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
- The verification harness executes an arbitrary product Python file with a `self-test` argument. Because `fp` comes from the inspected folder, a malicious product can place code in module top-level or in its self-test path and obtain code execution on the CI runner or analyst machine during what is presented as verification.
