Back to skill

Security audit

Fixture

Security checks for vulnerabilities and agentic risk

Overview

This skill is a mostly coherent local fixture manager, but its SQL export can generate unsafe executable SQL from imported data and one reset path deletes stored fixture records without a confirmation gate.

Install only if you are comfortable with a local CLI that stores data in ~/.fixture and can delete that stored data. Do not execute SQL exports against a real database unless the fixture data, field names, and table name are trusted and reviewed first; prefer JSON/CSV export for untrusted imported data.

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

Error
Location
scripts/script.sh:532
Finding

Unescaped SQL Export Enables SQL Injection

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh, lines 532–534
Vulnerability Type: SQL injection through unsafe SQL statement generation
Risk Level: High

Vulnerable Code

python
cols = ", ".join(fields.keys())
vals = ", ".join(f"'{v}'" if isinstance(v, str) else str(v) for v in fields.values())
f.write(f"INSERT INTO {table} ({cols}) VALUES ({vals});\n")

Technical Analysis

The SQL export feature constructs executable INSERT statements by directly concatenating untrusted table names, field names, and fixture values.

String values are enclosed in single quotes without escaping embedded quotes. Column names are joined without identifier validation or quoting, while the user-controlled --table value is interpolated directly into each statement. Fixture content can originate from the create, load, or import commands, including external JSON, JSONL, and CSV files.

For example, a field value such as:

text
x'); DROP TABLE users; --

can terminate the intended string and append an attacker-controlled SQL statement. Malicious table or column names may provide additional injection vectors. The generated SQL file therefore cannot safely be treated as executable database input.

Attack Path

  1. An attacker prepares a JSON, JSONL, or CSV fixture containing a malicious field name or value.
  2. A victim loads or imports that fixture using the documented CLI functionality.
  3. The victim exports the stored fixtures with export --format sql.
  4. Lines 532–534 place the attacker-controlled content into the SQL output without escaping or validation.
  5. The victim executes the generated SQL file against a database.
  6. The injected SQL runs with the privileges of the database account used for the import.

The same issue can be triggered directly through attacker-controlled arguments, particularly the --table option.

Impact Assessment

Successful exploitation can execute arbitrary SQL with the permissions of the ...[truncated 457 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not generate SQL through direct string concatenation of identifiers or values.
  • Validate table and column names against a strict allowlist or identifier pattern, such as ^[A-Za-z_][A-Za-z0-9_]*$.
  • Quote identifiers using rules appropriate to the selected database dialect.
  • Escape string literals correctly for the target database, including embedded quote characters.
  • Serialize NULL, boolean, numeric, date, and binary values explicitly rather than relying on Python's generic str() conversion.
  • Prefer generating parameterized import code or using a database driver with bound parameters when statements can be executed directly.
  • If standalone SQL output is required, require an explicit database dialect and use a trusted dialect-aware SQL generation library.
  • Add regression tests covering apostrophes, statement delimiters, SQL comments, malicious table and column names, Unicode, null values, and database-specific escaping behavior.
  • Clearly warn users not to execute generated SQL from untrusted fixture data until it has been reviewed.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The top-level description presents the skill primarily as a fixture generator, but the documented commands also import external files, export data to multiple formats including SQL, reset stored data, and persist templates/data under ~/.fixture. This mismatch can mislead users or higher-level agents about the real capability surface, increasing the chance of unsafe invocation or unintended data destruction/exfiltration.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documents file-writing behavior to ~/.fixture and implies environment/code execution capability via a bash script, but it declares no explicit tool scope such as allowed-tools or permissions. That weakens containment and transparency, making it easier for an agent to invoke filesystem-affecting behavior without clear user-visible authorization boundaries.

Content

No source excerpt is available for this finding.

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 · SKILL.md (reported line 12)May include surrounding context.

md
# Fixture — Test Data Fixture Generator

A CLI tool for generating, managing, and exporting test data fixtures. Create reproducible datasets from templates with seeded randomness for consistent test environments.

## Prerequisites

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The reset command can clear all fixtures or a whole type from persistent storage, but the documentation does not prominently warn about irreversible data loss. In an agent context, understated destructive behavior increases the risk of accidental deletion when the command is selected or parameterized automatically.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The --confirm flag allows bypassing the confirmation prompt for a destructive reset operation. In autonomous or semi-autonomous agent workflows, this reduces friction for mass deletion and can turn a mistaken invocation into immediate persistent data loss.

Content

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

md
**Arguments:**
- `--type` — Only reset fixtures of this type (optional)
- `--confirm` — Skip confirmation prompt (optional)

### template

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The reset command removes all fixtures of a specified type by rewriting the data file, but unlike the full reset path it provides no warning, confirmation gate, or explanatory comment before performing the deletion. This is a safety-relevant destructive operation on user data, and the only disclosure comes after the deletion has already happened.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.