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 harness executes arbitrary Python files in the target product directory by invoking each file with a `self-test` argument. In a CI or verification context, an attacker can place a malicious Python file in the scanned folder and achieve arbitrary code execution on the analyst or CI runner, which is especially dangerous because this skill is supposed to scan for secrets, not execute untrusted code.
