Skip to content

server: restrict default CORS to allowed origins - #1074

Closed
TheodorNEngoy wants to merge 1 commit into
modelcontextprotocol:v1/mainfrom
TheodorNEngoy:codex/restrict-cors-defaults
Closed

server: restrict default CORS to allowed origins#1074
TheodorNEngoy wants to merge 1 commit into
modelcontextprotocol:v1/mainfrom
TheodorNEngoy:codex/restrict-cors-defaults

Conversation

@TheodorNEngoy

Copy link
Copy Markdown

The inspector server currently installs cors() with default (permissive) settings.

This PR makes the default CORS policy match the existing origin allowlist logic:

  • Allow only ALLOWED_ORIGINS (comma-separated) or default to loopback origins based on CLIENT_PORT.
  • Still allows non-browser clients (no Origin header).
  • Keeps the existing originValidationMiddleware in place (defense in depth).

This reduces the blast radius if the proxy auth is disabled (DANGEROUSLY_OMIT_AUTH) or misconfigured.

@TheodorNEngoy
TheodorNEngoy force-pushed the codex/restrict-cors-defaults branch from e29fdd0 to 477bde9 Compare February 7, 2026 22:19
@TheodorNEngoy

Copy link
Copy Markdown
Author

Local sanity check on this branch:

  • npm run build-server

Build passes.

@cliffhall

cliffhall commented Jul 31, 2026

Copy link
Copy Markdown
Member

Closing: v1 is deprecated.

Thank you for this contribution, and apologies for the long wait for a response.

v1 will receive security fixes only. We reviewed every open v1 PR for security impact before closing — see the backlog triage in #1819 — and a small number were retained for a final 1.0.5 patch release. This one is a functionality, compatibility, or cleanup change rather than a vulnerability fix, so it is being closed unmerged. This is not a judgment on the quality of the work — it's a consequence of the branch it targets being frozen.

If the underlying problem still exists in v2, we'd genuinely like to know. Please open an issue describing it against v2. Note that we accept external contributions as issues rather than pull requests — maintainers handle design and implementation through a prompt-driven workflow. See CONTRIBUTORS.md.

Thanks again for taking the time to contribute to the Inspector.

@cliffhall cliffhall closed this Jul 31, 2026
@cliffhall cliffhall added the closed-v1-deprecated Closed: v1 is deprecated and accepting security fixes only label Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closed-v1-deprecated Closed: v1 is deprecated and accepting security fixes only v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants