Repository navigation
Conversation
fix vitejs#23620 Amp-Thread-ID: https://ampcode.com/threads/T-01a11cc6-e616-7785-90a4-bb90eb2bd03b Co-authored-by: Amp <amp@ampcode.com>
comp615
force-pushed
the
fix/colon-paths-posix
branch
from
November 23, 2026 15:22
71a4a04 to
30a6d0e
Compare
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.
fixes #23620
Since the previous CVE fix (#22572), Vite refuses to serve any path containing a
:. That makes sense on Windows, where : can't be in a file name, so it always means a stream. On macOS and Linux though,:is a normal file name character.At Square, we name route files after their route params, like
items/library/:id.tsx. Currently, the dev server returns 403 for them and Vitest failed with "Cannot find module". We've been patching Vite locally to skip the check outside Windows. But patches are annoying to carry forward, so I'd rather fix it here.What this changes:
Someone had previously done #23645, which was closed. The difference is that #23645 only strips the stream suffix from the last segment. That misses streams on directories, like .git::$INDEX_ALLOCATION/config.
One AI identified trade-off: if an NTFS volume is mounted on macOS or Linux, streams of files that aren't denied become readable again. That's how it worked before #22572.
But otherwise, I think the fix is better scoped after this (let's all ignore that obviously we wouldn't be naming with colons if we used windows dev machines which makes our repo unportable.)
Used AI to identify, verify and help author the code