Skip to content

    Type a page, a command such as keryn scan, or a rule id.

    supabase-ai-edge-v2

    View as Markdown

    7 rules · Keryn Software Licence · rules 0.8.0 · all packs

    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.edge-function-no-jwt-before-ai

    Section titled “seceng.supabase.edge-function-no-jwt-before-ai”

    warning typescript, javascript supabase

    Supabase Edge Function performs an AI/tool call without visible JWT user verification.

    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 authority is given or left unchecked.

    CWE-306 LLM02 LLM06 LLM10 ASI02 ASI08

    seceng.supabase.service-role-key-in-client-context

    Section titled “seceng.supabase.service-role-key-in-client-context”

    warning typescript, javascript supabase, nextjs

    Supabase service role key appears in browser/client context or NEXT_PUBLIC-style environment variable. Service role keys bypass RLS and must never ship to clients.

    Confidence 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.

    Edge inspected: reaches content or traffic gets to a thing; it crosses the user->prompt boundary (untrusted input reaching a prompt).

    CWE-798 CWE-200 LLM02 LLM03 LLM08 ASI03

    seceng.supabase-edge-service-role-trusts-request-user-id

    Section titled “seceng.supabase-edge-service-role-trusts-request-user-id”

    warning typescript, javascript supabase

    Supabase Edge Function uses service role client and request-supplied user_id or tenant_id. This can bypass RLS and cause IDOR or cross-tenant access.

    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 authority is given or left unchecked.

    CWE-639 LLM06 LLM08 ASI03 ASI02 ASI06

    seceng.supabase-edge-cors-wildcard-with-service-role

    Section titled “seceng.supabase-edge-cors-wildcard-with-service-role”

    warning typescript, javascript supabase

    Supabase Edge Function combines wildcard CORS with service role usage. This increases abuse risk for privileged AI/data endpoints.

    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 authority is given or left unchecked.

    CWE-346 LLM06 LLM08 ASI03 ASI02 ASI06

    seceng.supabase-ai-transcript-insert-with-request-user-id

    Section titled “seceng.supabase-ai-transcript-insert-with-request-user-id”

    warning typescript, javascript supabase

    Supabase insert writes chat, memory, document, or transcript data using request-supplied user_id or tenant_id.

    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: writes one thing writes to another.

    CWE-639 CWE-915 LLM02 LLM08 ASI03 ASI06

    seceng.supabase-auth-user-not-bound-to-query

    Section titled “seceng.supabase-auth-user-not-bound-to-query”

    warning typescript, javascript supabase

    Supabase auth user is fetched, but the subsequent AI-data query does not visibly bind records to user.id or tenant scope.

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

    Edge inspected: grants authority is given or left unchecked.

    CWE-639 LLM08 ASI03 ASI06

    seceng.supabase-storage-public-ai-documents

    Section titled “seceng.supabase-storage-public-ai-documents”

    warning typescript, javascript supabase

    Supabase storage bucket or file path for AI documents appears public. Public RAG documents can leak customer data or poison retrieval context.

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

    Edge inspected: reaches content or traffic gets to a thing; it crosses the user->prompt boundary (untrusted input reaching a prompt).

    CWE-200 CWE-732 LLM01 LLM02 LLM08 ASI06 ASI03