mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 08:45:58 +03:00
[PR #5982] fix(common): prevent open redirect in enter page #5442
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5442
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/hoppscotch/hoppscotch/pull/5982
Author: @jamesgeorge007
Created: 3/13/2026
Status: 🔄 Open
Base:
next← Head:fix/open-redirect-enter-vue📝 Commits (3)
5b8f70dfix(common): prevent open redirect in enter page3ee870dtest(common): add unit tests for enter page redirect validationaff808dfix(common): harden redirect validation and align with codebase conventions📊 Changes
3 files changed (+139 additions, -7 deletions)
View changed files
➕
packages/hoppscotch-common/src/pages/__tests__/enter-redirect.spec.ts(+92 -0)➕
packages/hoppscotch-common/src/pages/enter-redirect.ts(+24 -0)📝
packages/hoppscotch-common/src/pages/enter.vue(+23 -7)📄 Description
Addresses GHSA-27pm-c9ch-746q.
Closes FE-1164.
The
redirectquery parameter on/enterwas passed tonew URL()without validation, allowing redirects to arbitrary external domains.What's changed
platform.organizationand!isDefaultCloudInstance, so deployments without org-subdomain support and the default cloud instance skip this path.isSignInWithEmailLinkguard so/enteronly redirects during an actual magic-link auth flow, preventing use as a generic redirector.target.username/target.password) to block phishing-pattern redirects.enter-redirect.ts).Notes to reviewers
This preserves the intended cloud org magic-link flow where the user lands on the root domain and is redirected back to the organization subdomain after validation.
Deployments without org-subdomain support, and the default cloud instance, skip this redirect path.
Validate magic link flows for SH and cloud (default instance and org subdomain) to confirm no regression in sign-in behaviour.
?redirect=example.com?redirect=hoppscotch.io@example.com?redirect=acme.hoppscotch.io@hoppscotch.io?redirect=evil.com%0aacme.hoppscotch.io?redirect=example.com.hoppscotch.io.attacker.com?redirect=acme.hoppscotch.io/enter🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.