Back to skill

Security audit

Spec-First Development

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent spec-first development workflow, but it asks for broad shell access and can create project files from broad auto-triggers before explicit user confirmation.

Review this skill before installing. Its core behavior is not malicious, but it can alter a repository by writing SPEC.md and it grants shell access that is broader than necessary for a spec-writing workflow. Prefer a version that replaces Bash with a scoped search tool, checks before overwriting SPEC.md, and asks before creating files when auto-triggered.

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:6
Finding
Overly Broad Shell Execution Permission Violates Least Privilege<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 6 **Vulnerability Type**: Excessive tool permission **Risk Level**: Medium ### Vulnerable Code Snippet ```yaml name: spec-first-dev description: Spec-driven development workflow. Before writing any code, generates a comprehensive SPEC.md covering data models, user flows, API contracts, file structure, and edge cases. Forces the right order — spec first, code second. Prevents building the wrong thing. Use at the start of any non-trivial build task. argument-hint: [project description or goal] allowed-tools: Read, Write, Bash, Glob metadata: version: "1.0.0" ``` ### Technical Analysis The skill grants access to `Bash`, which generally permits arbitrary shell-command execution under the operating-system account running the agent. The documented workflow only requires discovering files, searching source code, reading content, and writing a specification. Those operations can be supported by narrowly scoped file and search tools. The skill explicitly instructs the agent to use Grep during codebase exploration, but `Grep` is not included in the allowlist. Instead, the substantially more powerful `Bash` tool is granted. If the agent uses Bash to compensate for the missing search tool, it receives capabilities far beyond source-code searching, including executing programs, modifying or deleting files, inspecting files outside the project, and potentially initiating network connections where the environment permits them. This is a least-privilege violation. The skill does not itself instruct the agent to execute malicious commands, so the issue is excessive capability exposure rather than demonstrated malicious execution. ### Attack Path 1. A user invokes the skill against a repository containing attacker-controlled content. 2. The skill directs the agent to explore that repository before creating `SPEC.md`. 3. During exploration, malicious or adversarial repository content attempts to ind ...[truncated 1426 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `Bash` from the default tool allowlist. 2. Add the narrowly scoped `Grep` capability that the workflow actually requires: ```yaml allowed-tools: Read, Write, Glob, Grep ``` 3. Restrict writes to the project root and, where feasible, specifically to `SPEC.md` and the optional `SPEC_APPROVED.md`. 4. If shell access is operationally unavoidable, replace unrestricted Bash access with an allowlisted command interface that permits only read-only search operations and rejects shell metacharacters, command substitution, pipelines, redirection, and arbitrary executable paths. 5. Run the skill in a filesystem sandbox limited to the target project, with outbound network access disabled and sensitive environment variables removed. 6. Require explicit user approval for any command that is not a read-only codebase inspection operation. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (3)

Vague Triggers

High
Confidence
97% confidence
Finding
The auto-trigger phrases ('build me', 'create a', 'implement a') are extremely broad and likely to match many ordinary requests, causing the skill to activate in situations the user did not explicitly intend. Because this skill writes files and imposes a workflow gate, overbroad triggering can lead to unwanted file modification, workflow disruption, and surprise behavior in benign conversations.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The workflow instructs the agent to use Grep during codebase exploration, but Grep is not declared in the allowed-tools manifest. This mismatch can cause the skill to fail unpredictably or encourage fallback to other tools such as Bash in ways that bypass intended tool restrictions and reduce auditability.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill directs writing SPEC.md to the project root before any explicit user approval for file modification, and it does not warn the user that it will create or overwrite a file. In a development environment, this can unexpectedly alter the repository state, overwrite existing documentation, or create side effects from an automatically triggered skill.

Static analysis

No suspicious patterns detected.