Skip to content

chore(supabase): remove debug session logging from browser client#71

Open
roshanraj9136 wants to merge 1 commit into
OpenLake:mainfrom
roshanraj9136:chore/remove-debug-session-log
Open

chore(supabase): remove debug session logging from browser client#71
roshanraj9136 wants to merge 1 commit into
OpenLake:mainfrom
roshanraj9136:chore/remove-debug-session-log

Conversation

@roshanraj9136
Copy link
Copy Markdown
Contributor

Summary

src/lib/supabase.ts ran a debug console.log of supabase.auth.getSession() at module load. Every page that imports the browser Supabase client would print the user's session — including access_token (JWT) and refresh_token — to the browser console.

The block was annotated // DEBUG: and is clearly leftover instrumentation. This PR removes it.

Why this matters

Auth tokens in the browser console are visible to:

  • shoulder-surfing / screen-recording / screen-sharing
  • malicious or buggy browser extensions that read console output
  • users who paste console output into bug reports
  • third-party analytics tools that scrape console logs

An attacker with the access token can impersonate the user for ~1 hour. With the refresh token, indefinitely until logout.

Classification: CWE-532 (Insertion of Sensitive Information into Log File).

Change

Removed the 7-line debug block. No functional change — getSession() is still called from useAuth and AuthContext where the result is consumed properly.

-// DEBUG: Check auth session at module load
-supabase.auth.getSession().then(res => {
-  console.log("📦 [supabase.ts] Initial session:", res);
-}).catch(err => {
-  console.error("❌ [supabase.ts] Session fetch error:", err);
-});
-

Testing

  • npx tsc --noEmit — no new errors.
  • The file's only export (supabase) is unchanged. All consumers continue to work.

The browser Supabase client module ran getSession() at import time and
console.log'd the result on every page load. The 'res' object contains
session.access_token (a JWT) and session.refresh_token, both of which
are sufficient to impersonate the user.

Logging this to the browser console exposes auth tokens to:
- shoulder-surfing / screen-recording / screen-sharing
- malicious or buggy browser extensions that read console output
- users who paste console output into bug reports
- third-party analytics tools that scrape console logs

The block was annotated 'DEBUG' and is clearly leftover instrumentation.
This removes it. No functional change — getSession() is already called
by useAuth and AuthContext where the result is consumed safely.

Refs: CWE-532 (Insertion of Sensitive Information into Log File)
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 7, 2026

@roshanraj9136 is attempting to deploy a commit to the OpenLake_Website Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 7, 2026

Warning

Review limit reached

@roshanraj9136, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 41 minutes and 40 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7ddc2420-2407-42dc-88bf-fdc06f684308

📥 Commits

Reviewing files that changed from the base of the PR and between cd02e34 and 31fab85.

📒 Files selected for processing (1)
  • src/lib/supabase.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant