hybrid-search-implementation

Warn

Audited by Gen Agent Trust Hub on Mar 8, 2026

Risk Level: MEDIUMCOMMAND_EXECUTIONEXTERNAL_DOWNLOADSPROMPT_INJECTION
Full Analysis
  • [COMMAND_EXECUTION]: Potential SQL injection vulnerability in the PostgresHybridSearch template.\n
  • Evidence: In SKILL.md, the hybrid_search method constructs a SQL query by interpolating dictionary keys directly into the where_clause string: where_clause += f" AND metadata->>'{key}' = ${len(params)}". While values are parameterized, the keys are not, allowing an attacker who controls the metadata keys to manipulate the SQL logic.\n- [EXTERNAL_DOWNLOADS]: Fetches pre-trained models from a trusted well-known service.\n
  • Evidence: The search_with_rerank method in SKILL.md uses sentence_transformers to load cross-encoder/ms-marco-MiniLM-L-6-v2. This operation downloads model weights from Hugging Face's official repository.\n- [PROMPT_INJECTION]: Exposure to indirect prompt injection through search query processing.\n
  • Evidence Chain:\n
  • Ingestion points: The query string enters the system via the hybrid_search and search methods in the templates.\n
  • Boundary markers: Absent; the query is passed directly to database search functions and neural reranking models without delimiters.\n
  • Capability inventory: Executes database queries (PostgreSQL/Elasticsearch) and performs model inference which can influence RAG output.\n
  • Sanitization: Database values are parameterized, but the raw query text is processed by semantic search engines without specific filtering for embedded instructions.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Mar 8, 2026, 07:40 AM