fix(cors): make prod CORS_ALLOWED_ORIGINS required (fail-closed)#108
Open
DavidHLP wants to merge 1 commit into
Open
fix(cors): make prod CORS_ALLOWED_ORIGINS required (fail-closed)#108DavidHLP wants to merge 1 commit into
DavidHLP wants to merge 1 commit into
Conversation
The previous default
${CORS_ALLOWED_ORIGINS:-http://localhost:9002,http://localhost:9003}
let production silently fall back to localhost origins if the operator
forgot to set the var — anyone running a local :9002/:9003 page could
then call the prod API with the user's cookie. Production fail-open.
Switch to ${CORS_ALLOWED_ORIGINS:?... is required}, matching the
existing fail-closed pattern used 10x in this file (NACOS_PASSWORD,
DB_PASSWORD, REDIS_PASSWORD, JWT_SECRET, ...). Dev fallback stays in
.env.example:36 (dev reads .env, never this prod compose default).
Fixes #102
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.
${CORS_ALLOWED_ORIGINS:?... is required}replaces thelocalhostfallback that let prod silently allow localhost cross-origin if the operator forgot to set the var. Aligns with the 10x existing fail-closed siblings in this file. Dev fallback stays in.env.example:36.Closes #102