fix: remove Playwright auth bypass from dashboard (GHSA-6c5j-4w43-2v8f #1)#593
Closed
advikdivekar wants to merge 2 commits into
Closed
fix: remove Playwright auth bypass from dashboard (GHSA-6c5j-4w43-2v8f #1)#593advikdivekar wants to merge 2 commits into
advikdivekar wants to merge 2 commits into
Conversation
The dashboard accepted a user-settable cookie playwright-dashboard-auth=1 combined with the env var PLAYWRIGHT_AUTH_BYPASS=1 to bypass GitHub OAuth entirely, rendering the page with session=null. Any contributor who copied the playwright.config.mjs env block to Vercel activated this bypass in production, allowing unauthenticated access to /dashboard. Remove the bypass entirely. Authentication is now unconditionally enforced via getServerSession. E2e tests requiring an authenticated session should use proper NextAuth JWT injection via the test setup rather than a production code path.
|
@advikdivekar is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel. A member of the Team first needs to authorize it. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
Contributor
Author
|
Closing — patch will be submitted through the private advisory fork (GHSA-6c5j-4w43-2v8f) to avoid public disclosure before coordinated release. |
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.
Problem
The dashboard page contained a cookie-based authentication bypass that could be activated in production by any visitor. Two conditions enabled it: the environment variable
PLAYWRIGHT_AUTH_BYPASS=1and a browser cookieplaywright-dashboard-auth=1that was neither server-set nor HttpOnly.Any contributor who copied the
playwright.config.mjsenv block into their Vercel deployment activated this bypass. From there, anyone who knew about it could set the cookie via DevTools and access/dashboardwithout GitHub OAuth.Root cause: Production code path that sets
session = nulland skipsgetServerSession, controlled by a user-settable cookie.What changed
src/app/dashboard/page.tsxallowPlaywrightBypasscondition and thecookies()import entirelygetServerSession(authOptions)How to verify
PLAYWRIGHT_AUTH_BYPASS=1set in env varsdocument.cookie = "playwright-dashboard-auth=1"/dashboard— redirected to/instead of rendering the dashboardRegression check
/as beforePLAYWRIGHT_AUTH_BYPASSorplaywright-dashboard-authin application codeFixes GHSA-6c5j-4w43-2v8f vulnerability #1 (Critical).