T09 · Insecure Skill Coding Practices
- 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
