similarity-search-patterns

Warn

Audited by Gen Agent Trust Hub on Sep 14, 2026

Risk Level: MEDIUMCOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTIONEXTERNAL_DOWNLOADS
Full Analysis
  • [COMMAND_EXECUTION]: A SQL injection vulnerability exists in the PgVectorStore.search method within SKILL.md. The implementation directly interpolates dictionary keys from the filter_metadata parameter into the SQL query string using f"metadata->>'{key}' = ${len(params)}". An attacker who can control the keys of the filter dictionary could inject malicious SQL fragments to bypass filters, modify queries, or extract unauthorized data from the database.
  • [INDIRECT_PROMPT_INJECTION]: The skill processes untrusted metadata filters which are interpolated into database queries without proper sanitization, creating an attack surface for data-driven exploits.
  • Ingestion points: filter_metadata parameter in the PgVectorStore.search method in SKILL.md.
  • Boundary markers: None present for the query construction logic.
  • Capability inventory: Database access via asyncpg driver.
  • Sanitization: Absent for the key component of the metadata filter dictionary.
  • [EXTERNAL_DOWNLOADS]: Fetches pre-trained transformer models from Hugging Face for result reranking. This is a standard operation for semantic search implementations.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Sep 14, 2026, 01:00 PM