fix(browse): replace wildcard CORS with localhost origin on sidebar endpoints#724
Open
garagon wants to merge 1 commit intogarrytan:mainfrom
Open
fix(browse): replace wildcard CORS with localhost origin on sidebar endpoints#724garagon wants to merge 1 commit intogarrytan:mainfrom
garagon wants to merge 1 commit intogarrytan:mainfrom
Conversation
…ndpoints Sidebar endpoints (/sidebar-tabs, /sidebar-tabs/switch, /sidebar-chat) responded with Access-Control-Allow-Origin: * which allows any cross-origin site to read chat history, tab data, and agent status from the local server. Replace with the actual localhost origin so only same-origin requests from the extension are accepted. Add regression tests for all sidebar endpoints.
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
Sidebar endpoints (
/sidebar-tabs,/sidebar-tabs/switch,/sidebar-chat) respond withAccess-Control-Allow-Origin: *. This allows any cross-origin website to read chat history, tab data, and agent status from the local browse server via fetch().Replace with
http://127.0.0.1:{port}so only same-origin requests from the extension are accepted.What changed
4 occurrences of wildcard CORS replaced with the actual localhost origin in browse/src/server.ts.
4 regression tests added to browse/test/server-auth.test.ts:
Test results
10/10 server-auth tests pass (6 existing + 4 new).