sql-query-optimizer
Warn
Audited by Gen Agent Trust Hub on Sep 14, 2026
Risk Level: MEDIUMINDIRECT_PROMPT_INJECTIONCOMMAND_EXECUTIONPRIVILEGE_ESCALATION
Full Analysis
- [INDIRECT_PROMPT_INJECTION]: The skill is designed to ingest and analyze SQL queries provided by users. The benchmarking utility in
scripts/benchmark-queries.tsexecutes these queries usingprisma.$queryRaw. If the agent interpolates untrusted user queries into these execution contexts without rigorous validation, it creates a SQL injection attack surface. - Ingestion points: User-provided SQL queries are processed for analysis and benchmarking.
- Boundary markers: None present to distinguish instructions from query data.
- Capability inventory: Uses
prisma.$queryRawandprisma.$executeRawto run commands against the connected database. - Sanitization: No sanitization or parameterization logic is present in the provided scripts.
- [COMMAND_EXECUTION]: The skill includes functionality in
scripts/detect-slow-queries.tsthat executes raw SQL commands to interact with database internals and configuration tables (pg_stat_statements). - [PRIVILEGE_ESCALATION]: The skill attempts to modify database-level configuration settings using the
ALTER DATABASEcommand to setlog_min_duration_statement. Performing these actions requires high-level database permissions (superuser or owner), which exceeds the typical scope of query optimization analysis.
Audit Metadata