mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #108] [MERGED] fix: dev sanitizeDestination now normalizes leading backslashes #317
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#317
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/108
Author: @threepointone
Created: 2/26/2026
Status: ✅ Merged
Merged: 2/26/2026
Merged by: @threepointone
Base:
main← Head:fix/dev-sanitize-destination-backslash📝 Commits (1)
a224232fix: dev sanitizeDestination now normalizes leading backslashes📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
packages/vinext/src/server/app-dev-server.ts(+1 -1)📄 Description
The dev server's
__sanitizeDestinationonly collapsed leading//but ignored leading backslashes (e.g.\evil.com). The prod version inconfig-matchers.tsalready used/^[\\/]+/to handle both.This aligns the dev codegen to match, closing a minor open-redirect vector where a rewrite destination starting with
\could be interpreted as a protocol-relative URL by the browser.Risk: LOW — redirect destinations are developer-configured via
next.config.js, and a request-level guard already blocks protocol-relative incoming paths. This fix ensures defense-in-depth parity between dev and prod.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.