hybrid-search-implementation
Fail
Audited by Gen Agent Trust Hub on Sep 22, 2026
Risk Level: HIGHCOMMAND_EXECUTIONDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The PostgreSQL search template in
references/details.mdcontains a SQL injection vulnerability. Specifically, thehybrid_searchmethod interpolates dictionary keys from thefilter_metadataparameter directly into the SQL query string (metadata->>'{key}') rather than using parameterized identifiers. If these keys are sourced from untrusted user input, an attacker could execute arbitrary SQL commands. \n- [DYNAMIC_EXECUTION]: The Elasticsearch search template inreferences/details.mdperforms unsafe string interpolation of theboost_vectorvariable into an Elasticsearchscript_scorequery. This pattern creates a risk of script injection if the boost parameter is not strictly validated before being interpolated into the Painless script. \n- [INDIRECT_PROMPT_INJECTION]: The skill facilitates the creation of RAG (Retrieval-Augmented Generation) systems that process untrusted external data, which is a primary surface for indirect prompt injection. \n - Ingestion points: The
queryandfilter_metadataparameters in thesearchandhybrid_searchmethods inreferences/details.mdare used to ingest data and control retrieval. \n - Boundary markers: No explicit delimiters or boundary instructions are included in the templates to help the agent distinguish between instructions and potentially malicious retrieved data. \n
- Capability inventory: The implementation uses database query clients and neural reranking models to process and act on retrieved content. \n
- Sanitization: The code lacks sanitization for metadata keys in SQL queries, creating an exploitable vulnerability surface.
Recommendations
- AI detected serious security threats
Audit Metadata