Back to skill

Security audit

Ai Pair

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but it asks agents to run with broad permission bypass and sends reviewed work to external AI CLIs without enough scoping or privacy warning.

Review carefully before installing. Use it only in projects where you are comfortable letting multiple agents read the workspace and where sending selected code or drafts to Codex and Gemini is allowed. Avoid secrets, credentials, customer data, regulated data, and proprietary material unless your policies permit those external providers. Prefer project-level installation and stop the team when finished.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:109
Finding
Unrestricted Permission Bypass for General-Purpose Subagents## Vulnerability Details **File Location**: `SKILL.md`, lines 109–111 **Vulnerability Type**: Excessive permissions and bypass of normal authorization controls **Risk Level**: Medium ### Vulnerable Code ```text ### Step 3: Launch Agents Launch 3 agents using the Agent tool with `subagent_type: "general-purpose"` and `mode: "bypassPermissions"` (required because reviewers need to execute external CLI commands and read project files). ``` ### Technical Analysis The skill directs the team lead to launch all three general-purpose subagents with `mode: "bypassPermissions"`. This disables normal permission checks for the developer or author as well as both reviewers. The stated justification applies only to reviewers that need to read project files and invoke the Codex or Gemini CLI. It does not justify unrestricted access for every agent, nor does it limit reviewers to read-only project access and narrowly defined commands. General-purpose agents can interpret repository files and user-provided content as part of their context; granting them unrestricted execution and filesystem access violates least-privilege principles and increases the consequences of prompt injection, unsafe task instructions, or model error. ### Attack Path 1. An attacker places adversarial instructions in a project file, review artifact, source-code comment, or other content that an agent is expected to read. 2. The user invokes the skill, which launches general-purpose agents with `mode: "bypassPermissions"`. 3. A subagent processes the attacker-controlled content as part of its task context. 4. The content induces the subagent to perform an unintended filesystem operation or execute an unintended local command. 5. Because permission checks have been bypassed, the operation can proceed without the approval boundary that would normally interrupt or prevent it. Exploitation depends on a subagent following malicious or misleading instructions; the repository does not itself contain such ...[truncated 927 chars]
Remediation
## Remediation Suggestions 1. Remove `mode: "bypassPermissions"` and retain normal interactive permission enforcement. 2. Assign permissions per role instead of applying one unrestricted mode to all agents: - Give the developer or author write access only to the designated project or working directory. - Keep reviewer agents read-only for project files. - Permit reviewers to write only uniquely created temporary review-input files when necessary. 3. Allowlist only the required executable and argument patterns for reviewers, such as narrowly scoped `codex exec` and `gemini -p` invocations. 4. Require explicit user approval for commands, access outside the project root, destructive operations, credential-related paths, and network actions beyond the declared review providers. 5. Treat repository files, source comments, and supplied content as untrusted data. Add explicit agent instructions not to execute commands or follow operational directives found inside reviewed material. 6. Prefer direct, argument-safe process invocation over shell pipelines. If temporary files remain necessary, create them with unpredictable names, restrictive permissions, and exclusive creation, then delete them after use. 7. Document that review content is transmitted to external model providers and require confirmation before sending potentially confidential code or documents.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The README explicitly instructs users to use multiple external CLIs and route work through separate reviewers, but it does not warn that prompts, source code, documents, or other sensitive material may be transmitted to third-party model providers. In a collaboration skill whose core function is to fan out user content to multiple services, omission of data-sharing and privacy implications can lead users to expose proprietary, regulated, or secret information without informed consent.

Skill Enumeration

Medium
Category
Agent Snooping
Content
### Option B: Manual | 手动安装

1. Download `SKILL.md` from this repo | 下载本仓库的 `SKILL.md`
2. Place it in `~/.claude/skills/ai-pair/SKILL.md` | 放到 `~/.claude/skills/ai-pair/SKILL.md`
3. Restart Claude Code | 重启 Claude Code

## Usage | 使用
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Vague Triggers

Medium
Confidence
95% confidence
Finding
Broad aliases like `ai pair`, `dev-team`, and `content-team` increase the likelihood of accidental or contextually ambiguous activation. In a skill that can create teams, launch agents, and potentially invoke external tooling, unintended activation raises the risk of unnecessary resource creation or exposure of workspace context.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The skill explicitly instructs launching agents in `bypassPermissions` mode so they can read project files and execute external CLIs. That grants subagents broader authority than is necessary for ordinary collaboration and review, increasing the chance that prompt-influenced reviewers can access sensitive data or perform unintended actions through the shell.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
This reviewer design shells project code out to the `codex` CLI via a pipe, which can transmit proprietary or sensitive source material to an external toolchain. Because the manifest presents a general collaboration skill, this data egress and command execution capability is broader than users may reasonably expect and creates confidentiality and supply-chain risk.

Natural-Language Policy Violations

Medium
Confidence
99% confidence
Finding
The Codex reviewer prompt explicitly instructs the external model to output in Chinese, and similar fixed-language instructions appear elsewhere in the file. This imposes a specific language on users without offering a choice or explaining a region-specific requirement, which violates the language/locale policy criteria.

Natural-Language Policy Violations

Medium
Confidence
99% confidence
Finding
This prompt requires Codex content reviews to be returned in Chinese regardless of the user's language preference. The file does not offer opt-in, a configurable locale, or a documented reason for the constraint.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The Gemini reviewer similarly pipes code to an external CLI, creating the same unnecessary external execution and data exposure risk. In a multi-agent setup, this risk is amplified because more than one reviewer may independently export repository content, increasing the volume and surface area of data leakage.

Natural-Language Policy Violations

Medium
Confidence
99% confidence
Finding
The Gemini code reviewer is instructed to output in Chinese, creating a fixed locale requirement embedded in the skill behavior. No user choice or justification is provided, so this is a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
99% confidence
Finding
The Gemini content reviewer prompt hard-codes Chinese output for all content reviews. Because the skill supports broad use cases and does not document a region-specific need, the locale is being forced without consent.

Static analysis

No suspicious patterns detected.