Back to skill

Security audit

Text To Sql

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward text-to-SQL prompt guide that does not execute SQL or request unusual system access, though generated queries should be reviewed before use.

Install only if you want a prompt skill that drafts SQL from schemas. Before running any generated query, verify the schema, SQL dialect, and parameters yourself; prefer bind parameters and a read-only database account, especially for user-supplied filter values.

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
SKILL.md:77
Finding

Generated SQL embeds values directly instead of using parameterized placeholders

Content
View full analysis
= '2024-01-01' ``` ### Technical Analysis The Skill instructs the agent to place values directly inside SQL literals but does not require bind parameters, separate parameter values, or safe literal escaping. If a user supplies attacker-controlled filter text, the generated query may embed that text directly into executable SQL. Although this project only generates SQL and does not execute it, a downstream application may run the generated query without further validation. In that context, specially crafted quotes, comments, or SQL expressions could terminate the intended literal and alter the query structure. ### Attack Path 1. An attacker supplies a natural-language request containing a malicious filter value, such as text designed to close a SQL string literal. 2. The agent follows the documented pattern and places that value directly between quotes in the generated SQL. 3. The generated query is copied into or automatically passed to a database client or application. 4. If the downstream component executes the query without parameterization or validation, the injected SQL changes the intended query behavior. 5. The resulting access depends on the database account used by that downstream component. ### Impact Assessment The Skill itself does not connect to a database and therefore grants no direct privileges. If unsafe generated SQL is subsequently executed, however, an attacker could potentially bypass query filters, read data available to the executing database account, modify records, or perform other operations permitted by that account. The scope is constrained by the downstream database user's privileges, configured SQL dialect, and whether multi-statemen ...[truncated 27 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill should be used to translate plain-English data requests into SQL based on schemas or table descriptions. However, the code chunk contains only a test harness for validating skill package structure and documentation quality. Its primary behavior is unrelated to SQL generation: it reads local files, parses YAML frontmatter, runs regex-based content checks, scans for secrets, and verifies repository artifacts. These are material, undeclared capabilities with a completely different purpose and trigger condition than the description. Therefore this is a clear description-behavior mismatch.

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

md
## What Problem This Solves

Non-technical users know what data they want ("show me revenue by month for the top 10 customers") but can't write SQL. This skill bridges the gap — takes a schema + natural language request and produces a syntactically correct query with table aliases, proper JOINs, and GROUP BY.

**When triggered:** Database schema + natural language question + write SQL intent.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README states that users must describe their data request 'in English', which is a natural-language policy constraint. The file does not provide an opt-in choice, alternative supported languages, or a documented justification for requiring English only.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring says this is an auto-generated test suite for skill "user-describes-data", but the manifest context for this skill is "text-to-sql" and the code operates generically over the current skill directory. This is an active documentation contradiction about which skill the test suite is for, not merely missing detail.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code includes a hard requirement that the skill repository contain README_zh.md, which imposes a specific language/locale expectation. The file does not indicate that this is optional, user-selected, or justified as a region-specific requirement, so it matches the language/locale policy violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file includes a natural-language policy constraint requiring contributors to keep the SKILL.md body in English. This is a language/locale restriction, and the document does not present it as optional or provide a justification for why only English is permitted.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This line explicitly mandates English for SKILL.md content and reference documentation. Under the policy, forcing a specific language without user opt-in or documented justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file is for the text-to-sql skill, but the documentation says "Detailed documents for user-describes-data skill." This actively contradicts the manifest context and can mislead maintainers about the skill's intended purpose.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.