Skip to content

fix: Prevent open redirect via double-slash path normalization#7

Open
cleptric wants to merge 1 commit intomainfrom
fix/open-redirect-double-slash
Open

fix: Prevent open redirect via double-slash path normalization#7
cleptric wants to merge 1 commit intomainfrom
fix/open-redirect-double-slash

Conversation

@cleptric
Copy link
Member

@cleptric cleptric commented Mar 9, 2026

Hono does not normalize double slashes in URL paths (honojs/hono#3034). A request to /skills//evil.com produces canonicalPath of //evil.com, which browsers interpret as a protocol-relative URL — redirecting the user to evil.com.

Uses Hono's getPath constructor option to collapse consecutive slashes at the router level, before any route matching or redirect logic runs.

Agent transcript: https://claudescope.sentry.dev/share/mE64lrYaS8EVww93heEqAqoTb37x04Zc9FGcrCTg_bs

Hono does not normalize double slashes in URL paths, so a request to
/skills//evil.com produces a redirect to //evil.com, which browsers
interpret as a protocol-relative URL. Use Hono's getPath constructor
option to collapse consecutive slashes at the router level.

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

Agent transcript: https://claudescope.sentry.dev/share/oruk15TIx-T3VD9E9APAKG1YnmXoIPJLuv3w7-34jj4
@vercel
Copy link

vercel bot commented Mar 9, 2026

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

Project Deployment Actions Updated (UTC)
skills-sentry-dev Ready Ready Preview, Comment Mar 9, 2026 3:09pm

Request Review

@cleptric cleptric self-assigned this Mar 9, 2026
@cleptric cleptric marked this pull request as ready for review March 9, 2026 15:09
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