similarity-search-patterns
Pass
Audited by Gen Agent Trust Hub on Sep 26, 2026
Risk Level: SAFEINDIRECT_PROMPT_INJECTION
Full Analysis
- [INDIRECT_PROMPT_INJECTION]: The PgVectorStore implementation in SKILL.md contains a vulnerability where metadata keys are interpolated directly into SQL queries.
- Ingestion points: The filter_metadata dictionary keys in the search method represent the point where untrusted data enters the query construction process.
- Boundary markers: The template lacks boundary markers or explicit instructions to distinguish between trusted SQL syntax and untrusted metadata keys.
- Capability inventory: The skill demonstrates the capability to perform asynchronous database operations using the asyncpg library.
- Sanitization: In the PgVectorStore.search method, dictionary keys are interpolated directly into an f-string to build SQL query fragments (e.g., metadata->>'{key}'). While query values are parameterized, the lack of sanitization for keys creates a surface for SQL injection if the keys are sourced from untrusted user input.
Audit Metadata