Vector search without top-k cap
ID |
vector-search-without-top-k-cap |
Severity |
low |
Remediation Complexity |
trivial |
Remediation Risk |
low |
Remediation Effort |
low |
OWASP LLM |
LLM10:2025 — Unbounded Consumption |
Family |
LLM10 — Unbounded Consumption |
Red-team vectors |
(none — LLM10 carries no red-team vector) |
Tags |
ai_security |
Description
A raw vector-search / retrieval call runs with no top_k / k / result-size bound and no framework default in effect. An unbounded result set flows into the prompt and drives runaway token consumption downstream.
Framework-default aware: LangChain similarity_search(…) and as_retriever(…) default k=4 and are not flagged (their default is encoded); only raw index queries (index.query(…), collection.search(…)) with no explicit bound fire.