Repository navigation
fix(cli): Drop the DSN header from session envelopes - #2423
Conversation
…t URL Session capture only accepted a POST to the exact ingest URL, so PHP's Spotlight transport (which adds /stream) got 401, and SDKs pointed at a DSN under the ingest URL (Go, Rust, PHP, Ruby build <path>/api/<project>/envelope/) got 401 too. The session now also accepts <ingest URL>/stream and <ingest URL>/api/<project>/envelope[/]. Each path still needs the ingest capability and gets the same loopback and CORS checks.
…est-paths Co-Authored-By: Aditya Mathur <[email protected]>
Go, Ruby and PHP copy their DSN, which holds the session ingest capability, into every envelope header. Session envelopes reach read-capability holders, so the daemon now removes the header's dsn key at session ingest, after decompression. Also document how each SDK reaches a session, build the session ingest regex from its path list, and test path traversal to reset.
…-header Co-Authored-By: Aditya Mathur <[email protected]> # Conflicts: # packages/cli/src/commands/local/control-plane.ts # packages/cli/src/commands/local/receiver-ingest.ts # packages/cli/test/commands/local/control-plane.test.ts
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
local run --session creates a new session on every run and only sets SENTRY_SPOTLIGHT, so Go, Rust and Ruby need a session from session create and the app run directly with a DSN under its ingest URL. Also strip a leading UTF-8 BOM before reading the envelope header, and cover that plain receivers keep the header's dsn. Co-Authored-By: Aditya Mathur <[email protected]>
MathurAditya724
left a comment
There was a problem hiding this comment.
Reviewed the refreshed exact head against current main. Full local typecheck, lint and workspace tests passed, including all 335 Local tests. Independent real-loopback probes passed for identity/gzip/deflate/Brotli requests, a BOM header, binary attachment byte preservation, raw envelope API reads, and read-capability SSE: the DSN/ingest capability is absent while other header metadata and item bytes remain intact. Plain receivers retain their existing behavior. Reviewed ingest-path/authorization consistency and generic diagnostics without sensitive header logging. No actionable findings; waiting for final hosted gates before squash merge.
Follow-up to #2396.
Go, Ruby and PHP copy their DSN into every envelope header. With
--session, that DSN holds the session's ingest key, so it ended up stored in the session and visible to anyone with only the read link. The daemon now removes thedsnkey from the envelope header before it stores or streams a session envelope. It does this after decompressing, so gzipped PHP and Ruby requests are covered too. Only the header line changes; the items are kept exactly as sent. Plainlocal runwithout a session leaves the header alone.Before:
After:
The docs now show how each SDK sends to a session. Node and Python use the ingest URL as is, and PHP sets
spotlightto the ingest URL. Go, Rust and Ruby need a DSN, whichlocal run --sessiondoesn't set, so you create a session withsentry local session create, turn itsingestUrlinto a DSN, run the app directly, and read events withsentry local event list <id>. I also removed the older docs line saying--sessiononly works with Node and Python.Two small cleanups: the session ingest regex is now built from the list of ingest paths so the two can't drift apart, and
..paths under the ingest key are covered so they can't reach the reset action.via @MathurAditya724.
--
View Session [Sentry]