Back to skill

Security audit

Spec Flow

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent spec-driven planning workflow, but it can drive broad repository changes in batch mode and includes a helper script with an unvalidated path input.

Install only if you are comfortable with a skill that writes .spec-flow documents and can later guide broad code edits. Use explicit spec-flow invocations, review tasks before implementation, avoid --fast or batch mode on untrusted or dirty repositories, and do not pass path-like feature names to execute-task.sh.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/execute-task.sh:24
Finding

Directory Traversal Through an Unvalidated Feature Name

Content
View full analysis
[task-id|--status]" echo "" echo "Commands:" echo " Show next pending task with context" echo " Execute specific task (e.g., T-003)" echo " --status Show progress summary" echo "" echo "Examples:" echo " ./execute-task.sh user-auth" echo " ./execute-task.sh user-auth T-003" echo " ./execute-task.sh user-auth --status" exit 0 fi SPEC_DIR=".spec-flow/active/$FEATURE_NAME" if [ ! -d "$SPEC_DIR" ]; then echo -e "${RED}Error: Spec directory not found: $SPEC_DIR${NC}" echo "Available specs:" ls -1 .spec-flow/active/ 2>/dev/null || echo " (none)" exit 1 fi TASKS_FILE="$SPEC_DIR/tasks.md" if [ ! -f "$TASKS_FILE" ]; then echo -e "${RED}Error: tasks.md not found in $SPEC_DIR${NC}" exit 1 fi ``` ### Technical Analysis `FEATURE_NAME` is incorporated directly into `SPEC_DIR` without syntactic validation or canonical path containment checks. Consequently, path components such as `../` are accepted and can cause the resolved directory to escape `.spec-flow/active/`. The initialization script prevents this condition by enforcing `^[a-z0-9-]+$`, but `execute-task.sh` does not apply the same validation. Quoting the resulting path prevents shell word splitting and command substitution, but it does not prevent filesystem path traversal. After accepting the escaped directory, the script reads `tasks.md` and may also read `design.md` and `requirements.md`. Its parsing and context-display functions print selected content from these ...[truncated 1484 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (22)

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · CONTRIBUTING.md (reported line 120)May include surrounding context.

md
### Documentation

- Keep README.md up to date
- Update SKILL.md for workflow changes
- Add examples for new features
- Use clear, concise language

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The documented behavior promises an interactive, phase-by-phase workflow that creates spec artifacts, but the analyzed behavior indicates additional undeclared actions such as validating existing artifacts, non-interactive CLI-style behavior, and reading filesystem contents. Behavior/description mismatches are dangerous because users may authorize a planning skill while it performs broader inspection or automation than advertised, reducing informed consent and increasing the chance of unintended file access or modification.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/examples/feature-example.md (reported line 91)May include surrounding context.

md
### Login

- **FR-010**: When a user submits valid credentials, the system shall return
  a JWT access token and set HTTP-only refresh cookie.
- **FR-011**: When credentials are invalid, the system shall return 401 with
  error code INVALID_CREDENTIALS.
- **FR-012**: If account is locked, then the system shall NOT authenticate

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/examples/feature-example.md (reported line 101)May include surrounding context.

md
### Login

- **FR-010**: When a user submits valid credentials, the system shall return
  a JWT access token and set HTTP-only refresh cookie.
- **FR-011**: When credentials are invalid, the system shall return 401 with
  error code INVALID_CREDENTIALS.
- **FR-012**: If account is locked, then the system shall NOT authenticate

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/examples/feature-example.md (reported line 102)May include surrounding context.

md
### Login

- **FR-010**: When a user submits valid credentials, the system shall return
  a JWT access token and set HTTP-only refresh cookie.
- **FR-011**: When credentials are invalid, the system shall return 401 with
  error code INVALID_CREDENTIALS.
- **FR-012**: If account is locked, then the system shall NOT authenticate

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/examples/feature-example.md (reported line 133)May include surrounding context.

md
### Login

- **FR-010**: When a user submits valid credentials, the system shall return
  a JWT access token and set HTTP-only refresh cookie.
- **FR-011**: When credentials are invalid, the system shall return 401 with
  error code INVALID_CREDENTIALS.
- **FR-012**: If account is locked, then the system shall NOT authenticate

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/examples/feature-example.md (reported line 120)May include surrounding context.

md
- **NFR-010**: The system shall hash passwords with bcrypt cost factor 12.
- **NFR-011**: The system shall NOT log passwords or tokens in any logs.
- **NFR-012**: Access tokens shall expire after 15 minutes.
- **NFR-013**: Refresh tokens shall expire after 7 days.

## Acceptance Criteria

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · CONTRIBUTING.md (reported line 11)May include surrounding context.

md
- **Feature Requests**: Have an idea? Share it in the issues
- **Documentation**: Improve README, examples, or references
- **Code**: Fix bugs, add features, improve templates
- **Templates**: Create new templates or improve existing ones
- **Examples**: Add real-world usage examples

## 🚀 Getting Started

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instruction to say "spec-flow" to trigger the skill gives a minimal activation phrase but does not explain when that trigger should or should not be used, nor does it provide exclusion conditions or negative examples. In a markdown file, this can create ambiguity about invocation scope and increase the chance of unintended activation in normal conversation or unrelated contexts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README advertises creating a .spec-flow directory, generating multiple documents, and eventually implementing code, but it does not prominently warn that the skill will modify the working tree or that batch execution may apply many changes at once. Users may invoke it without understanding the scope of filesystem and code changes, which is risky in a repository-integrated agent workflow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list contains broad natural-language phrases such as 'need a plan', 'structured development', and 'plan this feature' that could match ordinary user requests and activate the skill unexpectedly. In a skill that can create files and later drive implementation, accidental invocation increases the chance of unreviewed repository changes or an unintended workflow takeover.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
94% confidence
Finding

The documented '--fast' mode skips confirmations in a workflow whose final stage is implementation, and the example shows 'execute all tasks' leading directly to 'Implements everything'. Removing approval gates enables autonomous multi-step repository modification, which can amplify mistakes, prompt-injection effects from generated specs, or unintended code changes across many files.

Content

Scanner excerpt · README.md (reported line 51)May include surrounding context.

AI: [Implements everything]

text

Parameters: `--fast` (skip confirmations), `--skip-design` (simple features)

## Five-Phase Workflow

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Defaulting generated documents to Chinese without clear user opt-in can cause misunderstanding of requirements, design, and task outputs, especially in multilingual teams or when the user expected English. In a spec-driven workflow, language mismatch can lead to review failures or incorrect implementation decisions rather than direct code execution harm.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill explicitly instructs the agent to read multiple local files such as references/*.md, templates/*.template, and optional .spec-flow/steering/*, but it does not declare any permissions or allowed-tools scope. This creates a capability-transparency problem: users and hosting agents cannot reliably tell that filesystem reads are required, which can lead to unintended inspection of repository contents beyond what the user expected.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger list contains broad everyday phrases like 'need a plan', 'break this down', and 'design doc', which can cause accidental invocation in ordinary conversations. Because this skill creates and updates project files and guides workflow progression, unintended activation can lead to unwanted filesystem changes or context loading without clear user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Forcing all generated Markdown to be in Chinese without user opt-in can cause misunderstandings, review failures, and accidental misuse in teams expecting another language. While not a direct security exploit, it increases operational risk by making generated requirements and tasks less verifiable by some users, which can hide mistakes or unsafe instructions in practice.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrase "continue" is highly generic and commonly appears in normal conversation, making it prone to accidental activation. In this skill, it directly advances implementation tasks, so an unintended match could cause the agent to perform additional work or modify files without sufficiently explicit user consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Batch Mode uses broad natural-language triggers like "execute all" and "一口气执行完", which can be invoked accidentally or be interpreted outside a narrowly bounded workflow context. Because Batch Mode performs all remaining tasks at once, unintended activation could rapidly cause widespread file changes or execution of an entire implementation plan with limited opportunity for intervention.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document instructs the agent to update tasks.md automatically after execution but does not clearly warn users that selecting these modes will modify project files. In an implementation-oriented skill, insufficient disclosure of write actions weakens informed consent and increases the risk of unexpected repository changes, especially when combined with broad execution triggers.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file is written as binding interaction rules in Chinese and does not indicate that users may choose another language or locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The guideline "Include clear comments in Chinese and English" mandates specific languages for contributions. This is a natural-language locale policy constraint, but the document does not present it as optional, user-selectable, or justified by a region-specific requirement.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description says the skill creates a .spec-flow/ directory and multiple documents, but it does not prominently warn users up front that local files will be created or modified. This is a transparency and consent issue: even if the writes are expected for the workflow, users may invoke the skill for advice and not realize it will change the repository.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.