Skip to content

fix(telemetry-dashboard): accept Origin: null on login — no-referrer policy locked Chromium out (CG-16) - #1498

Open
colbymchenry wants to merge 1 commit into
mainfrom
bugfix/CG-16
Open

fix(telemetry-dashboard): accept Origin: null on login — no-referrer policy locked Chromium out (CG-16)#1498
colbymchenry wants to merge 1 commit into
mainfrom
bugfix/CG-16

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

Maintainer hit a plain 400 "bad request" submitting the correct password at stats.getcodegraph.com minutes after the cutover.

Root cause: the dashboard sends Referrer-Policy: no-referrer on every response, and Chromium's behavior on a same-origin form submit from such a page is to send Origin: null. isSameOriginPost() fed "null" to new URL() → throw → caught → false → 400. Every Chromium-family browser was locked out of the login form.

Why 231 assertions missed it: every passing login in the suites came from curl or Node fetch — neither sends an Origin header — and render-check injects its session cookie past the form. No test submitted the real form from a real browser page.

Fix: treat Origin: null as an unattributed origin (allow), same as the already-allowed absent header. The login POST carries no session to ride and the password is the credential; real foreign origins (https://evil.example) remain rejected — covered by tests. smoke-auth's sign-in and logout now post exactly as Chromium does (Origin: null), plus a new cross-origin logout rejection: 54 → 56 assertions, all green.

Already deployed to production (dashboard version 5154a826) and verified live: Origin: null + wrong password → 401, foreign origin → 400, browser login works.

🤖 Generated with Claude Code

…eferrer policy locked Chromium out (CG-16)

The dashboard sends Referrer-Policy: no-referrer, and Chromium's behavior
on a same-origin form submit from such a page is to send Origin: null.
isSameOriginPost() fed "null" to new URL(), which throws → false → 400
"bad request" for every Chromium user typing the correct password.

Treat a null Origin like an absent one: it is an unattributed origin, not
a foreign one — curl (no Origin at all) was always allowed, the login POST
carries no session to ride, and the password is the credential. Real
foreign origins stay rejected.

The regression net now posts the way Chromium actually does: the
smoke-auth sign-in and logout carry Origin: null, and cross-origin logout
gets its own rejection case (54 → 56 assertions). The suites missed this
because every passing login came from curl or Node fetch — neither sends
an Origin header — while render-check injects its cookie past the form.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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