hybrid-search-implementation
Warn
Audited by Gen Agent Trust Hub on Oct 22, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The
PostgresHybridSearch.hybrid_searchmethod inSKILL.mdcontains a SQL injection vulnerability. Specifically, keys from thefilter_metadatainput are directly interpolated into the SQL query string using f-strings (metadata->>'{key}'). If these keys are sourced from untrusted input, an attacker could manipulate the SQL query to bypass filters or access unauthorized data.\n- [DYNAMIC_EXECUTION]: TheElasticsearchHybridSearch.hybrid_searchmethod inSKILL.mdinterpolates theboost_vectorvariable directly into an Elasticsearch Painless script string using f-strings. This pattern is vulnerable to script injection if the boost value is provided by a user without strict numerical validation.\n- [INDIRECT_PROMPT_INJECTION]: The skill's search functions ingest untrusted user queries which are then processed by search engines and reranking models without sanitization.\n - Ingestion points: The
queryandfilter_metadataparameters inSKILL.md(Templates 2, 3, and 4).\n - Boundary markers: None identified; user input is interpolated directly into queries or passed to models.\n
- Capability inventory: Database interactions via
asyncpgandelasticsearchlibraries; network operations for model downloads viasentence-transformers.\n - Sanitization: Absent; the code relies on standard library implementations without additional validation of the content of the search terms.
Audit Metadata