security(CORE-1121): bind geolocation/notifications/fullscreen permissions to known server origin - #3395
Merged
Conversation
…sions to known server origin geolocation, notifications, and fullscreen permission requests were granted unconditionally (callback(true)) regardless of requestingUrl. Any origin loaded in the server webview — not just a configured Rocket.Chat server — could request and receive these permissions. Extracted isRequestFromKnownServer(requestingUrl, servers) to validate the request's origin against the app's configured server list (same pattern as isServerWebview in src/ipc/validateSender.ts), and gate the three permissions on it. media and openExternal already had proper validation; midiSysex/pointerLock are unaffected (low-risk permissions, out of scope for this ticket).
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
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. Comment |
Contributor
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
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
geolocation,notifications, andfullscreenpermission requests in the server webview were granted unconditionally (callback(true)) regardless of the requesting origin.isRequestFromKnownServer(requestingUrl, servers)insrc/ui/main/serverView/index.ts, validating the request's origin against the app's configured server list — same origin-binding pattern already used byisServerWebviewinsrc/ipc/validateSender.ts.mediaandopenExternalpermissions already had proper validation and are unchanged.midiSysex/pointerLockremain unconditionally allowed (low-risk, out of scope for CORE-1121).Test plan
npx tsc --noEmitcleanyarn eslintclean on changed filesisRequestFromKnownServer.main.spec.ts(8 cases: known origin match, trailing-slash server URL, unknown origin, undefined/invalid requestingUrl, empty server list, malformed server URLs in the list) — all passingSummary by CodeRabbit