sql-query-optimizer
Fail
Audited by Gen Agent Trust Hub on Feb 16, 2026
Risk Level: HIGHCOMMAND_EXECUTIONPROMPT_INJECTION
Full Analysis
- Privilege Escalation (HIGH): The script
scripts/detect-slow-queries.tsattempts to executeALTER DATABASE mydb SET log_min_duration_statement = 100;. This requires administrative or superuser privileges on the database and modifies system-level configurations. - Indirect Prompt Injection (HIGH): The skill is designed to ingest and process external SQL queries for optimization.
- Ingestion points: User-provided queries in
benchmark-queries.tsand log data frompg_stat_statementsindetect-slow-queries.ts. - Boundary markers: None present. The queries are passed directly into execution blocks.
- Capability inventory: Uses
prisma.$queryRawandprisma.$executeRawwhich execute raw SQL commands against the database. - Sanitization: No sanitization or validation of the SQL content is performed before execution, allowing a malicious query to perform unauthorized data modification or exfiltration during the 'benchmarking' phase.
- Dynamic Execution (HIGH): The use of
prisma.$queryRawinscripts/benchmark-queries.tsto run unknown queries for performance measurement constitutes dynamic execution of potentially malicious code. If an attacker provides a query containing destructive commands (e.g.,DROP TABLE), the agent will execute it as part of the benchmark process.
Recommendations
- AI detected serious security threats
Audit Metadata