T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/pr-review-loop.sh:63- Finding
Automatic Force-Merge Bypasses the Required Review Score
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a PR review automation helper, but it can drive merges and branch deletion even when the stated review score gate has not been met.
Review before installing. Use this only in tightly scoped trusted repositories with branch protection, least-privileged GitHub tokens, and explicit human approval before any merge or branch deletion. Remove or disable force_merge behavior and Telegram escalation unless they are deliberately configured and audited.
scripts/pr-review-loop.sh:63Automatic Force-Merge Bypasses the Required Review Score
scripts/pr-review-loop.sh:39Untrusted Repository Identifiers Are Interpolated into jq Programs
scripts/pr-review-loop.sh:10Caller-Controlled State Path and Predictable Temporary File Enable File Clobbering
The declared description presents an end-to-end autonomous PR review loop, but the supplied code chunk is only a review-fetching and decision-output helper. Its real behavior is limited to reading Greptile reviews/comments via GitHub API, extracting a score, maintaining loop state, and suggesting an action in JSON. While this supports a broader PR-review workflow, it does not itself carry out the key declared actions: fixing issues, committing/pushing updates, retriggering review, or merging. It also does not implement webhook or polling triggers. The code's primary purpose is narrower than the declared purpose, so this is a material description-behavior mismatch.
The skill performs destructive operations, including merging a PR and deleting its branch, without prominent warnings or guardrails. In this context, omission is dangerous because an autonomous agent may execute irreversible repository changes without adequate operator awareness, confirmation, or policy checks.
The documentation says to merge anyway after max rounds or repeated unchanged scores, directly bypassing the stated quality gate of score >= 4/5. In context, this is dangerous because it can force merges of inadequately reviewed or still-defective code, undermining review controls and potentially shipping vulnerable changes.
The script does more than fetch and parse review data: it decides whether to merge, including a 'force_merge' outcome after 5 rounds or 2 repeated scores, regardless of whether review issues remain unresolved. In the context of an autonomous PR-review skill, this creates a real integrity risk because downstream agents may treat this output as authorization to merge code that has not actually met policy or human approval requirements.
The manifest description says the skill should trigger on commands like "review my PR", which is broad natural language that could overlap with ordinary conversation rather than a tightly scoped command. The file does provide one specific trigger format, but it does not clearly constrain or exclude broader phrasings, increasing the risk of unintended invocation.
The skill directs the agent to repeatedly modify code, commit, and push to remote branches without clearly warning about the scope and persistence of those changes. This increases the chance of unintended code alterations, privilege misuse, or noisy automated churn, especially when review comments are ambiguous or manipulated.
The skill introduces an external notification path to a 'Master on Telegram' that is unrelated to core PR review mechanics and can cause unauthorized data egress. PR metadata, code review content, branch names, or repository details could be sent to an out-of-band channel without clear authorization or data handling controls.
The header comments describe the script as fetch/parse/output only, but the implementation persists state and makes autonomous merge-policy decisions. This mismatch is dangerous because reviewers, operators, or calling agents may grant it broader trust than intended and unknowingly enable risky auto-merge behavior.
This shell script calls gh api to retrieve pull request reviews and inline comments, then includes the review body and comments in its JSON output. The file contains no user-facing warning, prompt, or explanatory comment disclosing that remote PR metadata and comment text will be fetched and surfaced for downstream agent processing.
No suspicious patterns detected.