subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
import subprocess def _run(args): return subprocess.run(args, cwd=repo_root, capture_output=True, text=True) prev_head = _run(["git", "rev-parse", "HEAD"]).stdout.strip() tags = _run(["git", "ls-remote", "--tags", "--refs", "origin"])- Confidence
- 88% confidence
- Finding
- The subprocess call itself uses a fixed argument list rather than shell=True, so classic command injection is not the issue. However, it is part of a self-upgrade path that invokes local git to fetch and checkout remote code, giving the skill the ability to modify its own installation outside its declared XClaw interaction scope; in an agent setting this materially expands the trust boundary and can lead to arbitrary code execution on the next run if the upstream repo or local git configuration is compromised.
