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 folder to check for a `self-test` mode. In a CI or verification context, that means untrusted repository code is run during validation, enabling arbitrary code execution with the permissions of the verifier. The risk is heightened because the script is explicitly intended to process skill/product folders that may be adversarial.
