You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
id: supabase-n-plus-one-query
message: >
Performance Alert: Potential "N+1" query detected.
You are executing a Supabase query inside a loop (map/forEach).
Instead of looping to fetch related data, use Supabase "embedding"
to fetch children in the parent query (e.g., .select('*, posts(*)')).
severity: WARNING
languages: [ts, tsx, js, jsx]
patterns:
id: supabase-service-role-leak
message: >
CRITICAL SECURITY: Service Role key usage detected in client-side code.
Service Role keys bypass Row Level Security (RLS).
Only use anon keys in React/Vite components.
Move this logic to a Supabase Edge Function or backend server.
severity: ERROR
languages: [ts, tsx, js, jsx]
patterns:
id: supabase-unbounded-select
message: >
Performance Warning: Unbounded .select('*') detected.
Fetching all columns without a .limit(), .range(), or .single()
can cause performance issues on large tables.
Consider specifying columns or adding a limiter.
severity: INFO
languages: [ts, tsx, js, jsx]
patterns:
id: react-dangerously-set-inner-html
message: >
Security Risk: Usage of dangerouslySetInnerHTML.
This exposes the application to Cross-Site Scripting (XSS) attacks.
Ensure the content is sanitized (e.g., using DOMPurify) before rendering.
severity: WARNING
languages: [ts, tsx, js, jsx]
pattern: |
<... dangerouslySetInnerHTML={...} ...>
id: hardcoded-jwt-token
message: >
Security Risk: Hardcoded JWT or API Key detected.
Do not commit secrets to the repo. Use environment variables.
severity: ERROR
languages: [ts, tsx, js, jsx]
patterns:
`rules:
id: supabase-n-plus-one-query
message: >
Performance Alert: Potential "N+1" query detected.
You are executing a Supabase query inside a loop (map/forEach).
Instead of looping to fetch related data, use Supabase "embedding"
to fetch children in the parent query (e.g.,
.select('*, posts(*)')).severity: WARNING
languages: [ts, tsx, js, jsx]
patterns:
$ARR.map(async ($ITEM) => { ... })
await $CLIENT.from(...)
id: supabase-service-role-leak
message: >
CRITICAL SECURITY: Service Role key usage detected in client-side code.
Service Role keys bypass Row Level Security (RLS).
Only use
anonkeys in React/Vite components.Move this logic to a Supabase Edge Function or backend server.
severity: ERROR
languages: [ts, tsx, js, jsx]
patterns:
createClient(..., process.env.$KEY)
createClient(..., import.meta.env.$KEY)
metavariable: "$KEY"
regex: ".(SERVICE_ROLE|SECRET)."
id: supabase-unbounded-select
message: >
Performance Warning: Unbounded
.select('*')detected.Fetching all columns without a
.limit(),.range(), or.single()can cause performance issues on large tables.
Consider specifying columns or adding a limiter.
severity: INFO
languages: [ts, tsx, js, jsx]
patterns:
$CLIENT.from(...).select('*')
$CLIENT.from(...).select('*').limit(...)
$CLIENT.from(...).select('*').range(...)
$CLIENT.from(...).select('*').single(...)
$CLIENT.from(...).select('*').maybeSingle(...)
id: react-dangerously-set-inner-html
message: >
Security Risk: Usage of
dangerouslySetInnerHTML.This exposes the application to Cross-Site Scripting (XSS) attacks.
Ensure the content is sanitized (e.g., using DOMPurify) before rendering.
severity: WARNING
languages: [ts, tsx, js, jsx]
pattern: |
<... dangerouslySetInnerHTML={...} ...>
id: hardcoded-jwt-token
message: >
Security Risk: Hardcoded JWT or API Key detected.
Do not commit secrets to the repo. Use environment variables.
severity: ERROR
languages: [ts, tsx, js, jsx]
patterns: