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.searchmethod withinSKILL.md. The implementation directly interpolates dictionary keys from thefilter_metadataparameter into the SQL query string usingf"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_metadataparameter in thePgVectorStore.searchmethod inSKILL.md. - Boundary markers: None present for the query construction logic.
- Capability inventory: Database access via
asyncpgdriver. - Sanitization: Absent for the
keycomponent 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