Back to skill

Security audit

code-review

Security checks for vulnerabilities and agentic risk

Overview

This code-review skill is broadly aligned with its purpose, but it has under-scoped file persistence and unsafe report rendering that users should review before installing.

Install only if you are comfortable with a review skill that reads repository diffs, may scan local project Python files, spawns review subagents for larger reviews, and writes review artifacts. Avoid opening generated HTML reports from untrusted repositories until escaping is fixed, and check whether record.md, review_annotations.json, and report files should be created in your workspace. I found no artifact-backed evidence of credential theft, remote code download, destructive behavior, or system-level persistence.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/report_generator.py:531
Finding

Stored HTML and JavaScript Injection in Generated Review Reports

Content
View full analysis
Generated: {self.generated_at[:19]} {f' | Branch: {meta.get("branch", "N/A")}' if meta.get("branch") else ''} {f' | Range: {meta.get("base_sha", "")[:8]}..{meta.get("head_sha", "")[:8]}' if meta.get("base_sha") else ''} | Reviewer: {meta.get("reviewer", "agent")} ``` ```python items.append(f"""
{f['path']} {ann_badge} +{f['additions']} -{f['deletions']}
""") ``` ```python annotations_html += f"""
{sev} L{ann['line']} {ann.get('reviewer', '')}
{self._escape(ann['message'])}
{suggestion_html}
""" ``` ```python @staticmethod def _safe_id(path: str) -> str: """Convert file path to safe HTML ID.""" return path.replace("/", "-").replace(".", "-").replace(" ", "-") ``` ### Technical Analysis The report generator embeds several dynamic values directly into HTML without context-appropriate escaping: - Repository-controlled file paths are inserted into element text and the quoted `data-target` attribute. - Annotation reviewer names are inserted directly into ...[truncated 2315 chars]
Remediation
View remediation
``` For a fully self-contained report, move the inline script to a separately trusted resource or use a nonce/hash-based CSP. 5. Add regression tests using malicious values containing: ```text "> " onclick="alert(1) ``` The tests should verify that these strings appear only as encoded text and cannot create elements or attributes. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/diff_renderer.py:301
Finding

Terminal Control-Sequence Injection Through Malicious Diff and Annotation Content

Content
View full analysis
None: """Render a single diff line with colors and line numbers.""" c = self.c if line.type == "addition": prefix = "+" color = c.ADD_LINE elif line.type == "deletion": prefix = "-" color = c.DEL_LINE else: prefix = " " color = "" if self.show_line_numbers: old_num = str(line.old_line or "").rjust(num_width) new_num = str(line.new_line or "").rjust(num_width) num_str = f"{c.LINE_NUM}{old_num} {new_num}{c.RESET}" else: num_str = "" content = line.content max_content = self.max_width - (num_width * 2 + 6) if len(content) > max_content: content = content[:max_content - 3] + "..." self._emit(f" {num_str} {color}{prefix} {content}{c.RESET}") ``` ```python line = f" {icon} {loc} — {ann.message}{resolved}" if ann.suggestion: line += f"\n 💡 Suggestion: {ann.suggestion}" ``` ### Technical Analysis The terminal renderers write repository-controlled and externally imported data directly to the terminal: - Git fil ...[truncated 2290 chars]
Remediation
View remediation
str: text = str(value) text = text.replace("\x1b", r"\x1b") return _CONTROL_CHARS.sub( lambda match: f"\\x{ord(match.group(0)):02x}", text, ) ``` 5. Provide a safe plain-text mode that disables both renderer colors and all control sequences. 6. Add regression tests containing CSI, OSC 8 hyperlink, and OSC 52 clipboard sequences. Verify that output contains visible escaped representations rather than literal control bytes. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (21)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding points to additional undeclared behaviors such as filesystem mutation, temporary project/file creation, and test execution, which exceed a plain code-review role. When a skill's declared purpose does not match its effective actions, users may unknowingly authorize side effects such as writes or execution in contexts that should be read-only.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

This finding points to additional undeclared behaviors such as filesystem mutation, temporary project/file creation, and test execution, which exceed a plain code-review role. When a skill's declared purpose does not match its effective actions, users may unknowingly authorize side effects such as writes or execution in contexts that should be read-only.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill instructs use of shell, file read/write, and environment access but does not declare any explicit tool scope or permissions boundary. That increases the chance the runtime grants broader capabilities than reviewers expect, making it easier for the skill to read, write, or execute outside its legitimate review function.

Content

No source excerpt is available for this finding.

Shadow Command Trigger

Medium
Category
Trigger Abuse
Confidence
95% confidence
Finding

Using 'review' as a trigger conflicts with a built-in command, creating shadow-command ambiguity. This can cause the wrong handler to execute, which is especially dangerous here because the skill includes shell/file capabilities and broader behavior than a user may expect from the native command.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger set includes very broad phrases like 'review', which can activate during ordinary conversation or unrelated tasks. Overbroad activation is risky because it can unexpectedly invoke a skill with shell and file capabilities, increasing the chance of unintended command execution or workspace access.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Ambiguous trigger phrases increase accidental invocation risk, especially in multilingual natural-language environments. In a skill that can inspect files, run shell commands, and write artifacts, accidental activation broadens the attack surface and may cause unintended side effects.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The instruction to update a persistent record.md after every task introduces a write side effect unrelated to the stated code-review purpose. Persistent logging in the workspace can modify repositories unexpectedly, pollute commits, leak task metadata, or create a covert channel for cross-task state retention.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

A general task log write capability is broader than necessary for code review and can be abused to persist data across runs or alter user workspaces. Because the log target is generic and not narrowly scoped, it increases the risk of unintended file modification and hidden state accumulation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown reference is entirely written in Chinese and presents the scoring workflow as mandatory guidance, but it does not offer any language or locale choice. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring, CLI description, help text, and rendered report strings are written entirely in Chinese, which indicates the skill is designed to operate in a fixed language. There is no user opt-in, language-selection option, or justification that this is a region-specific tool, so it conflicts with the policy against forcing a specific language without user choice.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/visual_review.py (reported line 53)May include surrounding context.

python
"""Run a git command and return output."""
    cmd = ["git"] + list(args)
    try:
        result = subprocess.run(
            cmd, capture_output=True, text=True,
            cwd=cwd or os.getcwd(), encoding='utf-8', errors='replace'
        )

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The serve command writes an HTML report to a hard-coded path under the user's profile and application workspace, regardless of caller intent. In a security-sensitive agent environment, silent writes to a fixed workspace location can leak reviewed code or metadata into a shared/observable location and create unintended persistence outside the user's chosen output path.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code generates and saves an HTML file to a fixed workspace path without prior warning, opt-in, or path selection by the user. Because the report may contain code diffs, branch names, SHAs, and annotations, this behavior can unexpectedly persist sensitive review data and expose it to other tools, users, or processes monitoring that workspace.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill template is written entirely in Chinese and instructs the reviewer through Chinese-language headings and output structure, but it does not offer the user a language choice or indicate that the skill is intentionally limited to a Chinese-speaking context. This creates a natural-language policy concern because it implicitly enforces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file’s natural-language instructions and output format are written entirely in Chinese, effectively imposing a specific language/locale on the reviewer workflow. The policy allows language constraints only when the skill offers opt-in choice or clearly documents a justified region-specific constraint, neither of which appears here.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill directs modification of record.md without clearly warning that it will alter workspace files. Even if the write is low impact by itself, undisclosed side effects reduce user trust and can lead to accidental repository changes or persistence of sensitive operational context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The code writes a structured JSON report to a user-specified file, which falls under file-write operations to check for disclosure. Although the function name suggests saving, the file lacks an explicit warning or explanatory comment that review data and metadata are persisted to disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

This code performs file writes for generated HTML output, which is a safety-relevant operation under the audit criteria. While the method names indicate saving, there is no explicit warning, confirmation, or comment disclosing that report contents and metadata will be written to the specified path.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The template headings and risk guidance are written entirely in Chinese, which imposes a specific language/locale on generated output. The file does not indicate that Chinese is optional, user-selected, or required for a documented region-specific purpose.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/diff_renderer.py:31

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/report_generator.py:31