hybrid-search-implementation
Warn
Audited by Gen Agent Trust Hub on Sep 26, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTIONEXTERNAL_DOWNLOADS
Full Analysis
- [COMMAND_EXECUTION]: The
PostgresHybridSearch.hybrid_searchmethod inSKILL.mdis vulnerable to SQL injection. The implementation uses f-string interpolation to insert dictionary keys directly into a SQL query string (metadata->>'{key}'). If these keys are influenced by untrusted external input, an attacker could manipulate the query structure to bypass filters or access unauthorized records. - [DYNAMIC_EXECUTION]: The
ElasticsearchHybridSearch.hybrid_searchtemplate inSKILL.mdperforms dynamic script generation. It interpolates theboost_vectorvariable directly into an Elasticsearch Painless script. Without strict validation ensuring these variables are numeric, this pattern allows for script injection within the search engine's execution environment. - [INDIRECT_PROMPT_INJECTION]: The skill provides a
HybridRAGPipelinestructure that is susceptible to indirect prompt injection attacks where malicious instructions in indexed data could influence the agent. - Ingestion points: The pipeline ingests untrusted content from external vector and keyword stores in the
_vector_searchand_keyword_searchmethods inSKILL.md. - Boundary markers: The implementation lacks delimiters (e.g., XML tags) or specific instructions to the model to ignore embedded commands within the retrieved search results.
- Capability inventory: The pipeline includes database querying and neural reranking capabilities.
- Sanitization: No sanitization, escaping, or validation logic is applied to the retrieved content before it is passed to the reranker or potential downstream agent components.
- [DYNAMIC_EXECUTION]: The
search_with_rerankmethod inSKILL.mddownloads and initializes asentence_transformersreranking model. While the model is fetched from a well-known and trusted service (Hugging Face), the process involves loading remote model weights at runtime. - [EXTERNAL_DOWNLOADS]: The skill fetches a pre-trained reranking model (
cross-encoder/ms-marco-MiniLM-L-6-v2) from Hugging Face's official repository during the reranking step.
Audit Metadata