fix: replace permissive CORS wildcard with env-configurable origin (CodeQL #1, #2) - #1
Draft
Smannenbach with Copilot wants to merge 3 commits into
Draft
fix: replace permissive CORS wildcard with env-configurable origin (CodeQL #1, #2)#1Smannenbach with Copilot wants to merge 3 commits into
Smannenbach with Copilot wants to merge 3 commits into
Conversation
Co-authored-by: Smannenbach <148536460+Smannenbach@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix code scanning alert(s) flagged in this repository
fix: replace permissive CORS wildcard with env-configurable origin (CodeQL #1, #2)
Aug 19, 2026
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.
Fixes CodeQL
js/cors-permissive-configurationalerts in theeverythingserver's SSE and Streamable HTTP transports. Both transports usedorigin: "*", allowing cross-origin requests from any origin — a CSRF risk in deployed environments.Description
Replaces the hardcoded CORS wildcard with an env-driven origin in both transport files:
CORS_ORIGINunset → CORS disabled (safe default)CORS_ORIGIN=https://inspector.example.com→ single trusted originCORS_ORIGIN=*→ restores prior wildcard behavior explicitlyPublishing Your Server
Note: We are no longer accepting PRs to add servers to the README. Instead, please publish your server to the MCP Server Registry to make it discoverable to the MCP ecosystem.
To publish your server, follow the quickstart guide. You can browse published servers at https://registry.modelcontextprotocol.io/.
Server Details
everythingsrc/everything/transports/sse.ts,src/everything/transports/streamableHttp.tsMotivation and Context
CodeQL flagged
origin: "*"as a permissive CORS configuration in both transport entry points. Any web page could make cross-origin requests to the server, which is undesirable outside of controlled local dev setups.How Has This Been Tested?
TypeScript build passes. CodeQL scan returns 0 alerts post-fix.
Breaking Changes
Deployments that relied on open CORS (e.g., MCP Inspector direct-connect mode) must now set
CORS_ORIGIN=*or a specific origin explicitly. Local stdio usage is unaffected.Types of changes
Checklist
Additional context
Both alerts (
#1SSE transport,#2Streamable HTTP transport) were genuine — not false positives. TheCORS_ORIGINenv var is documented inline in both files.