AOSSIE-Org / AOSSIE-Org/Ell-ena

SUPABASE_SERVICE_ROLE_KEY in .env.example may be used client-side in Flutter - service role key bypasses all RLS policies

Ouverte
#306 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Dart
Étoiles
54
Forks
110
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

## Problem

`.env.example` includes `SUPABASE_SERVICE_ROLE_KEY` as a required variable.
The Supabase service role key is a superuser credential that bypasses all
Row-Level Security (RLS) policies. If this key is loaded into the Flutter
client app (e.g. via `--dart-define` or embedded in the app bundle), any user
who extracts it from the compiled app binary can:

1. Read, write, and delete any row in any table, bypassing all RLS policies.
2. Access other users' tasks, tickets, and meeting transcriptions.
3. Delete or corrupt the entire database.

Flutter app binaries are reverse-engineering targets; any secret embedded in
them must be considered public.

## Impact

Complete database compromise if the key is present in the Flutter client build.

## Suggested Fix

1. The service role key must ONLY be used in Supabase Edge Functions
(server-side), never in the Flutter client.
2. Remove `SUPABASE_SERVICE_ROLE_KEY` from any Flutter environment variable
configuration.
3. Audit all usages of `supabaseClient` in the Flutter `lib/` directory to
confirm none of them are initialized with the service role key.
4. Update `.env.example` with a comment explicitly warning:
"SERVICE_ROLE_KEY must never be used in client-side (Flutter) code."
5. Add documentation explaining which keys belong in Edge Functions vs. the
Flutter client.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.