Skip to content

JITSU-11: fix(ingest): stop reflecting Origin with allow-credentials on CORS responses - #1472

Merged
absorbb merged 1 commit into
newjitsufrom
fix/ingest-cors-credentials
Aug 19, 2026
Merged

JITSU-11: fix(ingest): stop reflecting Origin with allow-credentials on CORS responses#1472
absorbb merged 1 commit into
newjitsufrom
fix/ingest-cors-credentials

Conversation

@absorbb

@absorbb absorbb commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the CORS origin-reflection-with-credentials misconfiguration on the ingest API (JITSU-11, CVSS 8.2). CorsMiddleware in bulker/ingest/router.go previously reflected the request Origin into Access-Control-Allow-Origin and set Access-Control-Allow-Credentials: true — allowing any site to read credentialed cross-origin responses. It now serves a constant Access-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:

  • The jitsu-js event POST uses fetch without a credentials option (defaults to same-origin — no cookies were ever sent cross-origin); the anonymous id travels in the JSON payload.
  • The pixel endpoint (<img> GET) and /p.js script loads are not CORS-governed.
  • The SDK's only credentials: "include" call is the idEndpoint, which is same-origin by documented contract and not served by ingest.

Verify

After deploy, a request with a third-party Origin gets Access-Control-Allow-Origin: * and no Access-Control-Allow-Credentials header:

curl -si -X OPTIONS -H 'Origin: https://evil.example' https://t.jitsu.com/api/s/track | grep -i access-control

Known adjacent (out of scope, follow-up): bulker/admin/router.go and webapps/console/pages/api/destinations.ts have the same pattern.

🤖 Generated with Claude Code

…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>

@jitsu-code-review jitsu-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jitsu-code-review jitsu-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@absorbb
absorbb merged commit bd7e6f3 into newjitsu Aug 19, 2026
11 checks passed
@absorbb
absorbb deleted the fix/ingest-cors-credentials branch August 19, 2026 06:10
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