Back to skill

Security audit

Phy Planning With Files

Security checks for vulnerabilities and agentic risk

Overview

This planning skill is mostly purpose-aligned, but it automatically runs unbundled local scripts and repeatedly injects project-controlled planning text into the agent context.

Install only if you are comfortable with the skill creating persistent planning files in each project and running local helper scripts. Avoid enabling it in untrusted repositories until the script bundle is present and audited, and treat any existing task_plan.md content as untrusted input.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T01 · Skill Instruction Hijacking

Warning
Location
SKILL.md:16
Finding
Repository-Controlled Planning File Is Injected into Agent Tool Context<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:16-20` **Vulnerability Type**: Indirect prompt injection through untrusted project content **Risk Level**: Medium ### Complete Code Snippet ```yaml PreToolUse: - matcher: "Write|Edit|Bash|Read|Glob|Grep" hooks: - type: command command: "cat task_plan.md 2>/dev/null | head -30 || true" ``` ### Technical Analysis The `PreToolUse` hook reads the first 30 lines of `task_plan.md` before nearly every filesystem or command-related tool call. Because this file is located in the project directory, its content may be controlled by a repository author or another untrusted contributor. The hook does not validate the file format, restrict accepted fields, or clearly isolate the content as untrusted data. Consequently, a malicious `task_plan.md` can contain instructions designed to manipulate the agent. The content is repeatedly surfaced during the session, increasing the likelihood that the agent treats it as authoritative operational guidance. The shell command itself does not directly execute commands contained in `task_plan.md`. Exploitation depends on the agent interpreting the displayed content as instructions and subsequently invoking its available tools. ### Attack Path 1. An attacker creates or modifies `task_plan.md` in a repository. 2. The attacker places malicious instructions within its first 30 lines, such as requests to read sensitive files, run shell commands, or alter unrelated project files. 3. A victim opens the repository with this Skill enabled. 4. Before a matching `Write`, `Edit`, `Bash`, `Read`, `Glob`, or `Grep` operation, the hook reads the malicious content. 5. The injected text is presented in the agent's operational context. 6. If the agent follows the repository-controlled instructions, it performs attacker-directed actions using the tools and permissions available in the current session. ### Impact Assessment Successful exploitation can influence any op ...[truncated 657 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not automatically inject raw repository-controlled file content into the agent's instruction context. 2. Parse `task_plan.md` using a strict schema and accept only expected fields such as phase names, statuses, and identifiers. 3. Reject executable instructions, tool directives, embedded markup, and unexpected fields. 4. Present recovered content inside an explicit untrusted-data boundary, with a fixed warning that it must not override system, developer, user, or Skill instructions. 5. Require user confirmation before acting on recovered instructions that request command execution, sensitive file access, network activity, or changes outside the project. 6. Restrict the hook to a planning file created and authenticated by the current session where feasible. 7. Consider storing trusted planning state outside attacker-controlled repositories or protecting it with integrity metadata. 8. Apply least-privilege tool permissions so that prompt injection cannot automatically access unrelated files or execute high-impact commands. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:26
Finding
Execution of Unbundled Scripts from Mutable External Paths<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:26-34` and `SKILL.md:46-55` **Vulnerability Type**: Unsafe execution of scripts whose contents are absent from the audited package **Risk Level**: Medium ### Complete Code Snippets The automatic Stop hook executes scripts resolved through `CLAUDE_PLUGIN_ROOT`: ```yaml Stop: - hooks: - type: command command: | if command -v pwsh &> /dev/null && [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" || "$OS" == "Windows_NT" ]]; then pwsh -ExecutionPolicy Bypass -File "${CLAUDE_PLUGIN_ROOT}/scripts/check-complete.ps1" 2>/dev/null || powershell -ExecutionPolicy Bypass -File "${CLAUDE_PLUGIN_ROOT}/scripts/check-complete.ps1" 2>/dev/null || bash "${CLAUDE_PLUGIN_ROOT}/scripts/check-complete.sh" else bash "${CLAUDE_PLUGIN_ROOT}/scripts/check-complete.sh" fi ``` The session-recovery instructions also direct users to execute scripts from mutable home-directory installation paths: ```bash # Claude Code users python3 ~/.claude/skills/planning-with-files/scripts/session-catchup.py "$(pwd)" # Codex users python3 ~/.codex/skills/planning-with-files/scripts/session-catchup.py "$(pwd)" # Cursor users python3 ~/.cursor/skills/planning-with-files/scripts/session-catchup.py "$(pwd)" ``` ### Technical Analysis The audited project contains only `SKILL.md`; none of the referenced `check-complete.ps1`, `check-complete.sh`, or `session-catchup.py` scripts are present. Their behavior and integrity therefore cannot be verified as part of this package. The Stop hook automatically executes whichever script is resolved under `CLAUDE_PLUGIN_ROOT`. The documented recovery procedure similarly asks users to execute scripts from predefined locations beneath their home directories. If those paths refer to another installation, stale files, or files modified by another process, the executed code may differ from the reviewed Skill. On Windows, the hook additionall ...[truncated 1677 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Include every referenced script in the reviewed Skill package so its behavior can be audited. 2. Resolve scripts only relative to a trusted, canonical, immutable Skill root. 3. Validate that the resolved path remains inside the expected Skill directory before execution. 4. Verify script integrity using signed release artifacts or cryptographic hashes before invoking an interpreter. 5. Fail closed if a required script is missing, has unexpected ownership or permissions, or fails integrity validation. 6. Avoid silently falling back across multiple interpreters and scripts because this can obscure which code was executed. 7. Remove `-ExecutionPolicy Bypass` unless it is strictly necessary and supported by an explicit security rationale. 8. Do not direct users to execute files from generic mutable home-directory paths without validating that those files belong to the reviewed Skill version. 9. Pin the documentation, metadata, and bundled scripts to the same version and verify that the full package is present during installation. 10. Run helper scripts with the minimum required filesystem, network, and environment access. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Vague Triggers

Medium
Confidence
94% confidence
Finding
The description says to use the skill for complex tasks, research projects, or anything requiring more than five tool calls, which is a broad activation scope rather than a narrowly bounded operation. Over-broad applicability increases the likelihood the skill is invoked in sensitive repositories or workflows where its hooks, file writes, and shell scripts are unnecessary and risky.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
The skill grants Bash execution even though its primary purpose is planning via markdown files. In this skill, shell access is used not only for optional helpers but also in automatic hooks and documented startup steps, which increases the chance of unintended command execution in the user's environment and expands the blast radius beyond simple file planning.

Context-Inappropriate Capability

Medium
Confidence
96% confidence
Finding
The skill allows WebFetch and WebSearch, but the stated capability is local file-based planning and session tracking. Unnecessary network access broadens data-exposure and prompt-injection risk, especially when paired with a planning workflow that may persist fetched content into project files.

Missing User Warnings

Low
Confidence
91% confidence
Finding
The skill instructs the agent to create and update task_plan.md, findings.md, and progress.md in the project directory, but it does not provide an explicit upfront warning that activating the skill will modify the workspace. This can lead to unexpected file creation, repository noise, or accidental persistence of sensitive context into tracked files.

Static analysis

No suspicious patterns detected.