subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
"compiled from the user-supplied .stan file (artifacts land outside the " "skill directory, inherent to CmdStan).") print(f"Building model: {_safe_arg(model_file)}") build = subprocess.run([ "make", "-C", path, model_target ], capture_output=True, text=True) if build.returncode != 0:- Confidence
- 90% confidence
- Finding
- This subprocess call invokes `make` to build a user-supplied Stan model, which results in compilation and subsequent execution of attacker-controlled native code paths. Although the code avoids `shell=True`, uses absolute paths, and requires explicit opt-in, the operation is still a real code-execution sink and is dangerous in an agent skill because a caller can authorize execution and then run untrusted native build logic outside the skill directory.
