supabase-data-handling
Audited by Socket on Sep 9, 2026
2 alerts found:
Securityx2The code is primarily a legitimate RLS and PII-auditing example, with no evident malware or covert exfiltration. However, using SUPABASE_SERVICE_ROLE_KEY with a dynamic table scanner is a significant security risk if this code is shipped to or callable from an untrusted client, because the key bypasses RLS and select('*') can expose sensitive records. Keep the service-role key server-side, restrict table and column names with an allowlist, and ensure org_members is appropriately protected.
The code is consistent with a GDPR deletion and export utility and contains no clear evidence of malicious intent or obfuscation. However, it is high-impact administrative code with material security and correctness risks: an unauthorized caller could potentially delete or export arbitrary users if these functions are exposed without an external authorization layer, and failures can produce partial deletion without reliable auditing. It should remain strictly server-side, enforce requester authorization and validated identifiers, use transactional or resumable workflows, handle all errors explicitly, and protect audit-log integrity.