Dashboard › cli › Distillation
1859bd97-f497-4c22-a361-9f123ce0d686["lore_tm_v1_OJGdZdlqrxtBbVq-9r_X0vfs4jQa2fY03az_KJlJ0Is","lore_tm_v1_eRB78HEC8F_02w7coaIM3s1FCv38LaXhcR4GwQFPSxA","lore_tm_v1_2sD96DX4DTUUAiEw2B9j0RwWmuxar4HFP76Fwj-lrec","lore_tm_v1_6kWmty_XFruBfRBpXJEM9wKe9hgIOzdBS-8pXY0pLHM","lore_tm_v1_s_iuNeV6foprJl1AY_cYLmer38OhkhxaCqSby8hQ9Ww","lore_tm_v1_rWvOjbHUgKUZgeJOPlQdvaEGWQurz87nO5h3PTM9y1A","lore_tm_v1_nYSSopfJNri_EEejr0qnESf3pGNpFdaazdubAj933GA","lore_tm_v1_RIwFCyPMw8GqJqAkD6XUgQdW3Q6pIhH2eOvWpSWbDME"]
Date: Sep 10, 2026
ses_f75102ecbffemmfn06hnHH59uB completed and issued DO-NOT-MERGE. It found a MUST-FIX in packages/cli/src/lib/sentry-client.ts:410-411, 356-357: for valid fetch(Request, { body: ReadableStream }), a same-origin 307/308 redirect cannot resend because the initial native fetch and redirect snapshot share init.body; native fetch consumes the stream and redirected-request construction then throws due to a disturbed stream. Required regression: mock native consumption with new Request(input, init).text(), return same-origin 307, and assert the second POST receives the original stream payload.packages/cli/src/lib/sentry-client.ts:285, 359-363, 709-711: after POSTβ301/302 or non-GET/HEADβ303 method-changing redirects correctly become GET but drop all caller headers; if redirected GET gets retryable response, outer retry restores original POST/body while retaining transformed GET headers, losing Content-Type and other caller headers and commonly causing HTTP 415. Required regression: POST JSON with Content-Type: application/json; same-origin 302, then 503 from redirected GET; assert retried original POST has JSON body and original Content-Type.sntrys_ claim; SENTRY_FORCE_ENV_TOKEN switches both routing and bearer token; whitespace-only SENTRY_HOST falls back to SENTRY_URL; API, control, and region fallback route through the active token host; and cross-origin redirects fail before bearer or configured custom headers are sent.pnpm exec tsc --noEmit and targeted Biome checks passed. It reviewed unchanged HEAD 605e8318d1f316bd28f53763f71ed716d1869616 with diff SHA-256 70e2e3d4be2d13a4c54badf81fc4f930e403feb2ccd123d5b1099ecb3791facf.Location, or timeout/abort in redirect chains; no full-suite or CI evidence was available.ses_f750ffe9bffedUKF8qzSkyFYfq completed and issued DO-NOT-MERGE. It found HIGH-severity redirect trust mutation in sentry-client.ts:359, :420 and token-host.ts:129: redirect trust is revalidated against mutable active-auth state while reusing the old bearer from headers; if clearAuth() or auth-source change occurs while initial trusted request awaits fetch(), getActiveTokenHost() has no anchor and accepts attacker redirect, leaking original bearer. Required regression: defer trusted response, call clearAuth(), resolve with 302 to attacker, and assert rejection with exactly 1 outbound request.oauth.ts:210, :246, :521-525: OAuth refresh uses native redirect following after validating only initial host, so cross-origin 307/308 can forward refresh-token POST body and custom headers to redirect target. Required regression: use two local servers; trusted server responds 307 to attacker server; assert attacker receives neither refresh_token nor SENTRY_CUSTOM_HEADERS.sntrys-claim-mismatch.test.ts:261 covers only a 302 header case and sentry-client.test.ts:119 proves trusted 307 body forwarding, but no untrusted 307/308 test proves secret body, bearer, and custom header never reach attacker.70e2e3d4be2d13a4c54badf81fc4f930e403feb2ccd123d5b1099ecb3791facf.apiRequestToRegion always sends JSON and explicitly sets it."done" or "throw".throwOnError is always false because errors are handled internally.packages/cli/src/lib/token-host.ts defines host-scoped token trust: token destinations must match their recorded host before credentials attach. Trust permits exact origin matching (scheme, host, explicit port), plus strict HTTPS/default-port SaaS equivalence between https://sentry.io and *.sentry.io; non-SaaS hosts match exactly and do not use suffix matching (for example, sentry.acme.com does not trust sentry.acme.evil.com).packages/cli/src/lib/token-host.ts, getActiveTokenHost() mirrors getAuthConfig precedence: usable stored OAuth host wins over environment token unless a nonblank SENTRY_FORCE_ENV_TOKEN is set; with no stored OAuth selected, environment token host is returned when getRawEnvToken() exists.packages/cli/src/lib/token-host.ts, loginTrustAnchor is a process-local normalized anchor registered only by explicit --url/applyLoginUrl or boot-time environment snapshot, allowing OAuth device-flow custom headers for IAP-protected self-hosted instances during no-token bootstrap; .sentryclirc does not register an anchor. isLoginTrustAnchorFor() requires actual host match to prevent stale anchors admitting a different login host.packages/cli/src/lib/token-host.ts, isRequestOriginTrusted() returns true when no token is active and otherwise validates against active token host, including isTrustedRegionOrigin() regional silos. isRequestOriginTrustedForCustomHeaders() validates against active token host when present, otherwise against matching loginTrustAnchor, and fails closed when neither exists.prepareHeaders references in packages/cli/src/lib/sentry-client.ts: function definition at line 116 and calls at lines 359 and 679.