-
Notifications
You must be signed in to change notification settings - Fork 114
Fix/socket collaboration migration #1342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
61fb0e5
feat(collaboration): migrate real-time synchronization from Firestore…
vijaypatil477 9a28c3c
fix: dependency upgrades, ESLint 9 migration, Judge0 CE execution, Fi…
vijaypatil477 e82e9bf
fix(cors): reject requests missing Origin header with 403 status to m…
vijaypatil477 3f67b77
Merge branch 'main' into fix/socket-collaboration-migration
omkhandare55 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import js from '@eslint/js'; | ||
| import reactPlugin from 'eslint-plugin-react'; | ||
| import reactHooksPlugin from 'eslint-plugin-react-hooks'; | ||
| import reactRefreshPlugin from 'eslint-plugin-react-refresh'; | ||
| import globals from 'globals'; | ||
|
|
||
| export default [ | ||
| // Ignore patterns (replaces ignorePatterns in legacy config) | ||
| { | ||
| ignores: ['dist/**', 'vite.config.js'], | ||
| }, | ||
|
|
||
| // Base JS recommended rules | ||
| js.configs.recommended, | ||
|
|
||
| // React + React Hooks + React Refresh (eslint-plugin-react v7 flat config) | ||
| { | ||
| files: ['**/*.{js,jsx}'], | ||
| plugins: { | ||
| react: reactPlugin, | ||
| 'react-hooks': reactHooksPlugin, | ||
| 'react-refresh': reactRefreshPlugin, | ||
| }, | ||
| languageOptions: { | ||
| ecmaVersion: 'latest', | ||
| sourceType: 'module', | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.es2020, | ||
| }, | ||
| parserOptions: { | ||
| ecmaFeatures: { | ||
| jsx: true, | ||
| }, | ||
| }, | ||
| }, | ||
| settings: { | ||
| react: { | ||
| version: 'detect', | ||
| }, | ||
| }, | ||
| rules: { | ||
| // React recommended rules (v7 API) | ||
| ...reactPlugin.configs.recommended.rules, | ||
| // JSX runtime — disables react/react-in-jsx-scope for React 17+ | ||
| ...reactPlugin.configs['jsx-runtime'].rules, | ||
|
|
||
| // React Hooks recommended rules | ||
| ...reactHooksPlugin.configs.recommended.rules, | ||
|
|
||
| // Project-specific overrides | ||
| 'react/prop-types': 'off', | ||
| 'no-unused-vars': 'warn', | ||
| 'react-refresh/only-export-components': [ | ||
| 'warn', | ||
| { allowConstantExport: true }, | ||
| ], | ||
|
|
||
| // react-hooks v7 introduced stricter rules; downgrade to warn until | ||
| // the pre-existing patterns are refactored in a dedicated pass. | ||
| 'react-hooks/set-state-in-effect': 'warn', | ||
| 'react-hooks/purity': 'warn', | ||
| 'react-hooks/immutability': 'warn', | ||
| 'react-hooks/refs': 'warn', | ||
| }, | ||
| }, | ||
| ]; |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🔴 Critical | 🏗️ Heavy lift
Room reads now expose
passwordHash,passwordSalt, and private room code.Firestore rules are not filters.
allow read: if request.auth != nullgrants every signed-in user the full room document, includingpasswordHashandpasswordSalt.The write rules on Lines 24-25, 30, 34, and 38 block clients from writing those fields, and
server/routes/rooms.jsLine 75 calls them "server-only hash fields". This read rule contradicts that design. Any signed-in user can now export the hash and salt of every room and run an offline attack against the scrypt hash.The same rule also exposes
codefor every private room, so a user who does not know the password can read the room contents and bypass the password gate.Restrict document reads to participants, and move the fields needed for "inspect before join" into the existing
rooms/{roomId}/metasubcollection (Lines 95-98), which already has a narrower contract.🔒 Proposed direction
Write the join-time metadata (
name,passwordProtected) torooms/{roomId}/metafrom the server when the room is created.📝 Committable suggestion
🤖 Prompt for AI Agents