fix(ui): strip cookies from the analytics proxy request path - #599
Merged
JSONbored merged 1 commit intoJun 11, 2026
Merged
Conversation
handleAnalyticsProxy stripped response set-cookie but forwarded the browser's first-party request cookies to the Umami upstream, breaking its documented cookieless/strips-cookies guarantee and leaking session/OAuth cookies to the analytics host. Add cookie and x-forwarded-for to the request strip-list and set x-forwarded-for to the trusted cf-connecting-ip only (no client spoofing). Add the first handleAnalyticsProxy unit test.
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
JSONbored
approved these changes
Jun 11, 2026
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.

Closes #597.
handleAnalyticsProxystripped the responseset-cookiebut did not strip the requestcookieheader, so the browser's first-party cookies forgittensory.aethereal.dev(session / GitHub OAuth state) were forwarded to the Umami upstream (tasty.aethereal.dev) on every/stats/script.jsand/stats/api/send— breaking the documented "cookieless / strips cookies" guarantee (the #595 commit message explicitly claims it "strips cookies").Changes
cookietoSTRIP_REQUEST_HEADERSso first-party cookies are never forwarded upstream.x-forwarded-forto the strip-list and set it to the trustedcf-connecting-iponly (overwrite, not append) so a client-suppliedx-forwarded-forcan't spoof the visitor's geolocation.null(notundefined) for the no-bodyfetchso the file typechecks under the root tsconfig once a test imports it.test/unit/analytics-proxy.test.ts(first test for this proxy): cookies are not forwarded,set-cookieis not relayed back, a spoofedx-forwarded-foris ignored in favor ofcf-connecting-ip, and the path allowlist / 405 behavior holds.Verification
tsc --noEmitclean;analytics-proxy.test.ts3/3 (the cookie and x-forwarded-for assertions fail on the old code).apps/**is excluded from coverage, so the gate is unaffected.