subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
if result.returncode != 0: return None, "workspace is not a git repo — skipping commit" subprocess.run( ["git", "add", f"projects/{slug}/", f"skills/newsletter-launch/.skill-config/{slug}.json"], cwd=str(workspace), check=True, capture_output=True )- Confidence
- 79% confidence
- Finding
- The script passes a user-controlled slug into a git add pathspec, causing repository modification based on untrusted input. While shell injection is mitigated by subprocess argument lists, git still interprets pathspecs specially, so crafted values could stage unintended files or exploit option-like/pathspec semantics, especially because the tool auto-commits changes in the workspace.
