Skip to content

Conversation

@TheodorNEngoy
Copy link

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
Author

Local sanity check on this branch:

  • npm run build-server

Build passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant