Back to skill

Security audit

polish-new

Security checks for vulnerabilities and agentic risk

Overview

This code-review skill is coherent, but it grants broad command-running and repository-editing authority with unclear approval boundaries.

Install only if you are comfortable with an agent running repository-defined commands, launching sub-agents, and editing project files. Before use, constrain command execution, review any proposed validation command, require approval before modifying .gitignore or source files, and treat fix-review follow-up edits as requiring fresh approval.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:53
Finding

Execution of Untrusted Commands from Repository Instructions and Agent Reports

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:53-55, SKILL.md:132, and SKILL.md:232-234
Vulnerability Type: Untrusted command execution
Risk Level: High

Vulnerable Code Snippets

SKILL.md:53-55:

text
Run the project's lint + type-check command. Check CLAUDE.md (or the equivalent
project instructions) for the correct validation command - commonly `pnpm check`,
`just check`, `cargo clippy`, `uv run ruff check`. If none is documented, ask.

SKILL.md:132:

text
- Every finding carries reproducible evidence: the code site as `file:line`, the check performed as an exact command with its observed output (for a purely code-local finding, the quoted code itself is the check), and the source of any external fact as a path or URL. A finding whose evidence cannot be reproduced from its citations is a claim, and claims do not survive validation

SKILL.md:232-234:

text
**Reproduce, do not re-derive.** For each finding, run the command it cites and
compare the output; open the exact file and lines and confirm the code matches;
follow the path or URL behind any external fact.

Technical Analysis

The Skill directs the Agent to obtain validation commands from repository-controlled instruction files such as CLAUDE.md. It also requires the Agent to execute exact commands supplied in spawned-agent reports. Neither source is necessarily trusted: a repository under audit may be malicious, and agent findings can reproduce attacker-controlled instructions originating from that repository.

No command allowlist, shell-metacharacter validation, sandbox requirement, permission restriction, or explicit user confirmation is required before these commands are executed. The instruction to follow externally cited URLs also expands the trust boundary beyond the local repository.

This creates an indirect command-injection channel. Content presented as a lint command or evidence-reproduct ...[truncated 1497 chars]

Remediation
View remediation

Remediation Suggestions

  1. Treat repository instructions, source files, diffs, issue text, and spawned-agent reports as untrusted data.
  2. Resolve validation commands from recognized manifests and fixed project configuration rather than arbitrary prose files.
  3. Maintain an allowlist of permitted executables and argument forms. Reject shell operators, substitutions, redirections, pipelines, and dynamically constructed commands unless explicitly approved.
  4. Display any non-allowlisted command to the user and require explicit confirmation before execution.
  5. Run validation and reproduction commands in an isolated sandbox with:
    • Access limited to the reviewed repository.
    • No inherited secrets unless strictly required.
    • Network access disabled by default.
    • Resource and execution-time limits.
    • A non-privileged operating-system identity.
  6. Do not automatically follow arbitrary URLs. Validate the scheme and destination, block local and private-network targets where appropriate, and request approval before external access.
  7. Require reviewer reports to provide evidence as inert text. The parent Agent should independently reconstruct safe checks instead of executing report-supplied command strings verbatim.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:57
Finding

Repository Modifications Occur Before Explicit User Approval

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:57-60, contrasted with the approval requirement at SKILL.md:305
Vulnerability Type: Unauthorized pre-approval modification
Risk Level: Medium

Vulnerable Code Snippets

SKILL.md:57-60:

text
If checks fail: fix all errors, re-run until clean, then continue. Do not start
the review against a failing gate. When a failure predates the diff (it
reproduces on the base ref), still fix it - but record it in the ledger as
`pre-existing gate failure, fixed` and surface it in the report.

SKILL.md:305:

text
Fix nothing until the user explicitly approves.

Technical Analysis

Phase 1 requires the Agent to fix every validation error before beginning the review, including failures that predate the reviewed diff. These changes occur before findings are presented to the user and before the explicit approval gate described later in the Skill.

This creates contradictory authorization semantics: one instruction mandates immediate modification, while the later instruction says that nothing may be fixed without approval. The earlier rule can cause unrelated files and pre-existing behavior outside the intended review scope to be changed automatically.

The risk is amplified by the command-trust issue because a repository-controlled validation command can generate broad or crafted failures. The Agent is then instructed to repair all reported errors without first confirming the affected paths or obtaining consent.

Attack Path

  1. A repository contains pre-existing validation failures, or its validation process reports failures in files outside the reviewed change.
  2. The Skill runs the validation process during Phase 1.
  3. The Skill directs the Agent to fix all failures, explicitly including failures that predate the diff.
  4. The Agent modifies unrelated source or configuration files before presenting findings and requesting approval.
  5. T ...[truncated 741 chars]
Remediation
View remediation

Remediation Suggestions

  1. Make Phase 1 read-only: run validation, record failures, and do not edit files.
  2. Classify failures as in-diff or pre-existing and present both classes in the report before making changes.
  3. Require explicit user approval for every proposed fix disposition, including validation-gate repairs.
  4. Default pre-existing and out-of-scope failures to a separate change unless the user expressly authorizes them.
  5. Enumerate the files and findings covered by approval so that a general instruction cannot silently authorize unrelated modifications.
  6. Capture and verify the original working-tree state before any approved write, preserving staged, unstaged, and untracked content.
  7. After changes, report every modified path and map it to an approved finding. Stop and request additional approval if clearing the gate requires modifications outside that set.
  8. Remove the contradictory instruction to fix failures before approval and make the approval requirement apply consistently to every phase.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the agent to modify the project's ignore file automatically to add .agents/polish/. That changes tracked repository state outside the user's explicit approval flow and can silently alter version-control behavior, potentially hiding artifacts or introducing unwanted diffs in the user's branch.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
88% confidence
Finding

Phase 6 authorizes the skill to apply code fixes across the working tree after a broad approval such as 'go' or 'proceed'. Because fixes can affect multiple files and include additional class-wide changes, this grants the skill authority to modify repository code autonomously beyond a narrowly confirmed patch set, increasing the risk of unintended or overbroad edits.

Content

Scanner excerpt · SKILL.md (reported line 308)May include surrounding context.

md
nothing until the user explicitly approves.

If zero issues survive, report "Clean - no issues found", substantiate the
correctness zero, offer next actions, and stop - a clean report needs no
approval line.

## Phase 6: Fix

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

The fix-review phase explicitly tells the skill to 'act autonomously' with 'no approval gate' and to fix newly found defects immediately. This creates an unbounded self-modifying loop where the agent can continue editing code based on its own judgments, potentially compounding mistakes, expanding scope, or making substantial repository changes without further user authorization.

Content

Scanner excerpt · SKILL.md (reported line 342)May include surrounding context.

md
- Does each new or strengthened test fail when its fix is reverted?
- Did any fix reverse a decision recorded in the ledger without saying so?

Classify the round's findings and act autonomously - no approval gate here:

- **Defects** - a fix does not hold, is class-incomplete, or introduced a problem: fix them now; the next round reviews only those new edits
- **Residuals** - cosmetic, taste, or not worth an edit: record in the ledger, disclose in the summary, no edit, no new round

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · LICENSE.txt (reported line 27)May include surrounding context.

text
permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation source, and
configuration files.

"Object" form shall mean any form resulting from mechanical transformation or

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · LICENSE.txt (reported line 31)May include surrounding context.

text
permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation source, and
configuration files.

"Object" form shall mean any form resulting from mechanical transformation or

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · LICENSE.txt (reported line 54)May include surrounding context.

text
permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation source, and
configuration files.

"Object" form shall mean any form resulting from mechanical transformation or

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · LICENSE.txt (reported line 147)May include surrounding context.

text
permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation source, and
configuration files.

"Object" form shall mean any form resulting from mechanical transformation or

Static analysis

No suspicious patterns detected.