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_search method in SKILL.md contains a SQL injection vulnerability. Specifically, keys from the filter_metadata input 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]: The ElasticsearchHybridSearch.hybrid_search method in SKILL.md interpolates the boost_vector variable 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 query and filter_metadata parameters in SKILL.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 asyncpg and elasticsearch libraries; network operations for model downloads via sentence-transformers.\n
  • Sanitization: Absent; the code relies on standard library implementations without additional validation of the content of the search terms.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Oct 22, 2026, 12:05 PM