JITSU-11: fix(ingest): stop reflecting Origin with allow-credentials on CORS responses - #1472
Merged
Merged
Conversation
…sponses The ingest API is intentionally open and stateless for browsers: no supported client sends credentialed cross-origin requests to it. Serve a constant Access-Control-Allow-Origin wildcard and drop the Access-Control-Allow-Credentials header, removing the origin-reflection- with-credentials misconfiguration. JITSU-11 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Reviewed in this PR, focused on CORS behavior, security impact, and request-flow correctness.
The change correctly removes reflection plus and uses a constant wildcard origin for this credential-less ingest surface. I didn’t find additional correctness or regression issues in this diff.
There was a problem hiding this comment.
Reviewed bulker/ingest/router.go in this PR with focus on CORS security and request-flow correctness.
This change removes Origin reflection and drops Access-Control-Allow-Credentials, while returning a constant wildcard origin for this credential-less ingest API. I did not find additional correctness or user-visible regression issues in the diff.
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.
Summary
Fixes the CORS origin-reflection-with-credentials misconfiguration on the ingest API (
JITSU-11, CVSS 8.2).CorsMiddlewareinbulker/ingest/router.gopreviously reflected the requestOriginintoAccess-Control-Allow-Originand setAccess-Control-Allow-Credentials: true— allowing any site to read credentialed cross-origin responses. It now serves a constantAccess-Control-Allow-Origin: *and omits the allow-credentials header. The wildcard is browser-enforced as incompatible with credentialed requests, so cross-origin reads are guaranteed to be cookie-less.No supported client is affected:
credentialsoption (defaults tosame-origin— no cookies were ever sent cross-origin); the anonymous id travels in the JSON payload.<img>GET) and/p.jsscript loads are not CORS-governed.credentials: "include"call is theidEndpoint, which is same-origin by documented contract and not served by ingest.Verify
After deploy, a request with a third-party
OrigingetsAccess-Control-Allow-Origin: *and noAccess-Control-Allow-Credentialsheader:Known adjacent (out of scope, follow-up):
bulker/admin/router.goandwebapps/console/pages/api/destinations.tshave the same pattern.🤖 Generated with Claude Code