Repository navigation
Conversation
mentatpsi
force-pushed
the
fix/open-in-editor-csrf
branch
from
November 24, 2026 05:41
bf9b924 to
c6f069c
Compare
Author
|
New tests are failing given CI differences. They're passing locally. I'll debug. |
Hardening (not a reported vulnerability): the launch-editor middleware at /__open-in-editor opens the developer's configured editor on a caller- supplied file path with no origin check, so any page the developer visits while the dev server runs can trigger it with a cross-site GET. Impact is low (blind; opens existing files only), but the endpoint is easy to align with how Vite already guards other dev-only endpoints. Reject requests whose Sec-Fetch-Site is `cross-site`. Same-origin (Vite's own client), same-site (e.g. another local dev port, since the port is not part of the site, so cross-port setups keep working) and direct user navigations are allowed. For clients that do not send Sec-Fetch-Site, fall back to comparing the Origin hostname, ignoring the port; a request with no Origin is a non-browser client and is allowed. No new dependencies. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mentatpsi
force-pushed
the
fix/open-in-editor-csrf
branch
from
November 24, 2026 05:50
c6f069c to
c841730
Compare
Author
|
Fixed. Feel free to decline the PR. It's just a minor quality of life improvement for developers. |
Author
|
Not to sure about the remaining CI pipelines. I read that it could just be race conditions. Can someone take a look? |
This branch has not been deployed
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.
There's a minor local developer pathway that allows an external actor to exploit the /__open-in-editor endpoint. It has little merit outside helping developers.
I have researched a bit, and I cannot find a legitimate pathway that allows for RCE... it can still spam the user and generally be a nuisance.
If the user is running a memory intensive editor like Visual Studio, for instance... a user could effectively be sent a minor DoS from an external site if the Editor decides to spawn the opening of the documents as separate processes. Essentially spamming them with a burst of open requests until the computer needs to be restarted. The attack does not persist, hence more a trolling. Worst case... it could cause the need for a restart mid development, risking lost work.
The code is minor and a simple cross site check. It only touches the endpoint and I've also pushed it to a helper function to avoid cluttering the index.ts