# supabase-rag-rpc-v2

> supabase-rag-rpc-v2: 4 Keryn rules for typescript, javascript, python (3 warning, 1 info).

Source: https://keryn.dev/rules/supabase-rag-rpc-v2/

4 rules · Keryn Software Licence · rules 0.8.0 · [all packs](https://keryn.dev/rules/)

**How to read a rule**

- **Severity**: How bad the finding is if it is real: `error` fails a default gate, `warning` and `info` do not.

- **Confidence**: **P0** exploitable as written; **P1** dangerous in context; **P2** a heuristic or a posture check: confirm by reading the code.

- **False-positive risk**: **low**: an exact API or flag, so hits are almost always real; **medium**: the pattern is legitimate in many programs, so check each hit; **high**: it finds a lead to confirm, so expect benign hits.

- **Edge**: The relationship the finding sits on. **reaches**: content or traffic gets to a thing; **calls**: one thing invokes another; **reads**: one thing reads from another; **writes**: one thing writes to another; **sends**: data leaves for another party; **grants**: authority is given or left unchecked; **depends_on**: something relies on a component it does not verify; **trusts**: one party believes another without evidence. The boundary it crosses, when there is one: **user->prompt** (untrusted input reaching a prompt); **model->code** (model output reaching code, a shell, a query or a page); **secret->outside** (a secret leaving the trusted side); **supply-chain** (code, models or prompts pulled in from outside).

- **Taxonomy chips**: References for readers who work in OWASP LLM 2025, OWASP Agentic, CWE or NIST AI RMF. They say where a rule belongs, not that a framework is satisfied.

## seceng.supabase.rag-rpc-missing-tenant-parameter

`warning` typescript, javascript supabase

Supabase vector/RAG RPC function appears to accept embedding/query and match count without tenant\_id, user\_id, or ownership parameter.

Confidence **P2**: a heuristic or a posture check: confirm by reading the code. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-639](https://keryn.dev/taxonomies/cwe/#cwe-639-authorization-bypass-through-user-controlled-key) [LLM08](https://keryn.dev/taxonomies/owasp-llm/#llm08-vector-and-embedding-weaknesses) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning)

Also reported under the older id `seceng.supabase.postgrest-rpc-without-auth-context`.

## seceng.supabase.rag-rpc-request-match-count-unbounded

`warning` typescript, javascript supabase

Supabase RAG RPC receives request-controlled match\_count or limit without visible bounding. This can cause excessive retrieval or cost abuse.

Confidence **P2**: a heuristic or a posture check: confirm by reading the code. False-positive risk **medium**: the pattern is legitimate in many programs, so check each hit.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-770](https://keryn.dev/taxonomies/cwe/#cwe-770-allocation-of-resources-without-limits-or-throttling) [CWE-20](https://keryn.dev/taxonomies/cwe/#cwe-20-improper-input-validation) [LLM10](https://keryn.dev/taxonomies/owasp-llm/#llm10-unbounded-consumption) [LLM08](https://keryn.dev/taxonomies/owasp-llm/#llm08-vector-and-embedding-weaknesses) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning) [ASI02](https://keryn.dev/taxonomies/owasp-agentic/#asi02-tool-misuse-and-exploitation)

## seceng.supabase.rag-document-insert-without-metadata-owner

`info` typescript, javascript, python supabase

Supabase RAG document or embedding insert does not visibly include tenant/user metadata. Later retrieval may be impossible to isolate.

Confidence **P1**: dangerous in context. False-positive risk **high**: it finds a lead to confirm, so expect benign hits.

Edge inspected: [grants](https://keryn.dev/docs/edges/edge-kinds/#grants) authority is given or left unchecked.

[CWE-1220](https://keryn.dev/rules/?cwe=CWE-1220) [LLM08](https://keryn.dev/taxonomies/owasp-llm/#llm08-vector-and-embedding-weaknesses) [ASI03](https://keryn.dev/taxonomies/owasp-agentic/#asi03-identity-and-privilege-abuse) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning)

## seceng.supabase.rpc-query-text-directly-from-request

`warning` typescript, javascript supabase

Request query text is passed directly to Supabase RAG RPC without visible prompt-injection filtering or query policy.

Confidence **P1**: dangerous in context. False-positive risk **high**: it finds a lead to confirm, so expect benign hits.

Edge inspected: [reaches](https://keryn.dev/docs/edges/edge-kinds/#reaches) content or traffic gets to a thing; it crosses the [`user->prompt`](https://keryn.dev/docs/edges/trust-boundaries/#user-to-prompt) boundary (untrusted input reaching a prompt).

[CWE-20](https://keryn.dev/taxonomies/cwe/#cwe-20-improper-input-validation) [LLM01](https://keryn.dev/taxonomies/owasp-llm/#llm01-prompt-injection) [LLM08](https://keryn.dev/taxonomies/owasp-llm/#llm08-vector-and-embedding-weaknesses) [ASI01](https://keryn.dev/taxonomies/owasp-agentic/#asi01-agent-goal-hijack) [ASI06](https://keryn.dev/taxonomies/owasp-agentic/#asi06-memory-and-context-poisoning)
