T09 · Insecure Skill Coding Practices
- Location
scripts/auto_merge.py:17- Finding
Configured Minimum Approval Threshold Is Not Enforced
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a real PR auto-merge tool, but it can merge code with weaker controls than it promises.
Review before installing. Use only dry-run mode unless you have verified the script yourself, do not rely on `--min-approvals` for policy enforcement, avoid the `pip install gh` workflow example, and run any live merge job with tightly scoped GitHub credentials and server-side branch protection enabled.
scripts/auto_merge.py:17Configured Minimum Approval Threshold Is Not Enforced
SKILL.md:85CI Example Installs an Unpinned and Potentially Incorrect PyPI Package
This is a substantive behavior mismatch, not just a documentation issue: the skill advertises a minimum approval threshold that is reportedly not enforced, so PRs may be merged with fewer approvals than operators expect. It also frames the non-squash path as a merge option while apparently invoking --admin --merge, which uses elevated privileges and can bypass normal branch protection expectations, making autonomous merges significantly more dangerous.
The skill clearly instructs execution of shell commands (python3, gh, cron/Actions snippets) but does not declare any permissions or allowed-tools scope. That omission weakens safety boundaries because an agent or platform may not have an explicit policy gate for command execution, increasing the chance of unintended repository-modifying actions.
The documentation promotes autonomous merging and labels dry-run as 'safe' without an equally explicit warning that --no-dry-run performs irreversible repository state changes. In an automation/scheduling context, understated risk messaging can lead users to deploy unattended write actions against production repositories without appreciating the consequences.
The script advertises and accepts a --min-approvals threshold but never enforces it, relying only on GitHub's coarse reviewDecision == APPROVED state. In an autonomous merge agent, this can merge pull requests with fewer approvals than operators expect, weakening change-control protections and potentially allowing unsafe or malicious code to be merged automatically.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
cmd = ["gh"] + args
if repo:
cmd[2:2] = ["--repo", repo]
result = subprocess.run(cmd, capture_output=True, text=True)
return result
def get_prs_to_merge(repo, min_approvals=2, dry_run=True):
No suspicious patterns detected.