T09 · Insecure Skill Coding Practices
- Location
scripts/monitor.py:127- Finding
Untrusted GitHub PR Metadata Is Rendered Without Terminal-Safe Sanitization
- Content
View full analysis
4} {score_str:>8} #{e['number']:<4} {status_str:<8} " f"{e['author']:<18} {e['date']} {e['title']}{marker}{suspect_marker}" ) ``` ### Technical Analysis The PR title and author are obtained from the external GitHub API. The title is truncated to 75 characters, but it is not sanitized before being interpolated into terminal output. Length truncation does not neutralize ANSI escape sequences, C0/C1 control characters, carriage returns, bidirectional text controls, or other display-altering characters. Consequently, attacker-controlled PR metadata may alter how the leaderboard appears in a terminal, conceal legitimate output, or display fabricated status and ranking information. The Skill documentation also directs an AI Agent to invoke this script and interpret its results. In that context, instruction-like text from a malicious PR title enters the Agent-visible tool output without an explicit trust-boundary marker. This creates an indirect prompt-injection surface, although the code does not itself execute PR content as shell commands or Python code. ### Attack Path 1. An attacker creates a pull request in the monitored `openai/parameter-golf` repository. 2. The attacker places crafted control sequences, misleading Unicode formatting, fabricated leaderboard text, or instruction-like content in the PR title. 3. The victim or AI Agent runs `scripts/monitor.py`. 4. `fetch_prs()` retrieves the attacker-controlled metadata from the GitHub A ...[truncated 1311 chars]- Remediation
View remediation
