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
- Vorherrschende Sprache
- Dart
- Sterne
- 54
- Forks
- 110
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
## 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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.