server: restrict default CORS to allowed origins - #1074
Conversation
e29fdd0 to
477bde9
Compare
|
Local sanity check on this branch:
Build passes. |
|
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 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 Thanks again for taking the time to contribute to the Inspector. |
The inspector server currently installs
cors()with default (permissive) settings.This PR makes the default CORS policy match the existing origin allowlist logic:
ALLOWED_ORIGINS(comma-separated) or default to loopback origins based onCLIENT_PORT.Originheader).originValidationMiddlewarein place (defense in depth).This reduces the blast radius if the proxy auth is disabled (
DANGEROUSLY_OMIT_AUTH) or misconfigured.