Skip to content

add proxy cookie leak repro test#3809

Closed
MustafaMulla29 wants to merge 1 commit into
mainfrom
agent/reproduce-easyeda-proxy-cookie-leak
Closed

add proxy cookie leak repro test#3809
MustafaMulla29 wants to merge 1 commit into
mainfrom
agent/reproduce-easyeda-proxy-cookie-leak

Conversation

@MustafaMulla29

Copy link
Copy Markdown
Contributor

Summary

  • add a local-only integration test for the CLI dev server's /api/proxy route
  • send a synthetic PostHog-style localhost cookie through the proxy
  • verify that the upstream target does not receive proxy-origin cookies
  • avoid any dependency on EasyEDA or other external services

Why

A standard USB-C connector can fail to load in tsci dev because the browser sends its localhost analytics cookie to /api/proxy. The proxy currently forwards that cookie to EasyEDA when X-Sender-Cookie is empty, and EasyEDA's CloudFront/WAF rejects the request with 403 Forbidden.

The test reproduces the header leak directly using local CLI and target HTTP servers.

Current result

This draft intentionally contains a failing regression test until the proxy fix is implemented:

expect(received).toBeUndefined()
Received: "ph_test_posthog=..."

Validation

  • bun run format:check — passes
  • bun test tests/cli/dev/proxy-cookie-isolation.test.ts — fails as expected, proving the synthetic localhost cookie reaches the target

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