Remove OAuth token storage from sessionStorage to prevent XSS theft (Issue #272)#319
Open
anshul23102 wants to merge 1 commit into
Open
Remove OAuth token storage from sessionStorage to prevent XSS theft (Issue #272)#319anshul23102 wants to merge 1 commit into
anshul23102 wants to merge 1 commit into
Conversation
Eliminates sessionStorage usage for GitHub OAuth access tokens. Tokens are now stored only in memory during the current session, making them inaccessible to JavaScript-based XSS attacks. Security improvements: - Removes sessionStorage read/write of OAuth tokens - Tokens no longer persist across page refreshes - Leverages Firebase Auth session management - HTTP-only cookies used by Firebase for secure session persistence - Prevents token theft via DOM access Session handling: - Firefox Auth maintains session via secure HTTP-only cookies - Token available only in memory during active session - Page refresh requires fresh authentication - This is secure default behavior per OAuth best practices Fixes issue indresh404#272
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
Please add relevant labels:
These help with tracking and prioritization. Thank you! |
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.
Summary
Eliminates sessionStorage usage for GitHub OAuth access tokens. Tokens are now stored only in memory during the current session, making them inaccessible to JavaScript-based XSS attacks.
Problem
GitHub OAuth access tokens are stored in sessionStorage, which is accessible to all JavaScript code on the page. An XSS vulnerability allows attackers to:
Attack vector:
sessionStorage.getItem("gh_access_token")Solution
Removed all sessionStorage usage for OAuth tokens:
Security Benefits
XSS Prevention:
Session Persistence:
Technical Details
Before:
After:
Behavior Change:
Changes
Testing Strategy
Files Modified
Migration Notes
Frontend:
Backend:
Fixes #272