Security: Add warning — never use service_role key in client-side code#2
Open
soloexpert wants to merge 1 commit intoDHTMLX:mainfrom
Open
Security: Add warning — never use service_role key in client-side code#2soloexpert wants to merge 1 commit intoDHTMLX:mainfrom
soloexpert wants to merge 1 commit intoDHTMLX:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security Warning Addition
Vulnerability class: Supabase
service_rolekey exposure in client-side codeWhy this PR: We scanned 100 public repos built with Lovable + Supabase templates and found 65% (65/100) had Supabase
service_rolekeys committed to client-side code — often because developers filled their actual keys into template.envplaceholders without knowing the danger.This template is the upstream source for many of those apps. Adding a prominent warning here prevents the mistake at the root.
What changed:
.env.example— added comment block warning: never useservice_rolein client apps, with a link to Supabase docsThe danger (CWE-312: Cleartext Storage of Sensitive Information):
The
service_rolekey grants full database admin access with no RLS enforcement. If committed and deployed, any visitor to the app can read, write, or delete ALL data in the database via direct API calls.Evidence: 65 of 100 scanned Lovable-generated repos had this issue. The DHTMLX template already does this correctly — this PR adds a warning comment so developers who copy the template understand why the anon key is used and never substitute the service_role key.
Found by Frogeye — security knowledge graph for AI-generated code. Try it free:
claude mcp add --transport sse --scope user frogeye https://mcp.frogeye.ai/sse