Skip to content

add proxy cookie leak repro test - #145

Closed
MustafaMulla29 wants to merge 2 commits into
tscircuit:mainfrom
MustafaMulla29:agent/reproduce-proxy-cookie-leak
Closed

add proxy cookie leak repro test#145
MustafaMulla29 wants to merge 2 commits into
tscircuit:mainfrom
MustafaMulla29:agent/reproduce-proxy-cookie-leak

Conversation

@MustafaMulla29

@MustafaMulla29 MustafaMulla29 commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • add a regression test to the existing proxy route test suite
  • send a synthetic localhost PostHog cookie through /proxy
  • assert that the target server does not receive the proxy-origin cookie
  • mark the known regression with Bun's test.failing so the suite remains green
  • keep the reproduction fully local and deterministic

Why

The proxy starts with a copy of every incoming request header. When X-Sender-Cookie is empty, the browser's localhost Cookie header remains in that copy and is forwarded to the target. EasyEDA's CloudFront/WAF rejects the unexpected cookie with 403 Forbidden, preventing standard USB-C connector data from loading in tsci dev.

This is a file-server boundary issue: the CLI exposes this route by consuming @tscircuit/file-server, while runframe only supplies the proxy endpoint.

Expected-failure behavior

The assertion describes the correct behavior: the target should receive no proxy-origin cookie. test.failing records that the current implementation violates the assertion without failing CI. Once the proxy is fixed, Bun will report the unexpected pass, prompting the test to be converted to a normal test.

Validation

  • bun test — 30 pass, 0 fail
  • bun run format:check — passes
  • bunx tsc --noEmit — passes
  • bun run build — passes

@MustafaMulla29
MustafaMulla29 marked this pull request as ready for review July 23, 2026 07:06
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