Open Redirect at *.myshopify.com/account/login?checkout_url=
The login page on any myshopify.com shop accepted a checkout_url parameter that was appended to the shop's hostname without a separator, so a crafted value could redirect a logged-in user to an attacker-controlled domain. An attacker could send a victim a link that, after login, sent them to a lookalike site.
Originally disclosed on HackerOne
- Triaged in 35 hours
- Fixed in 2 days
- Paid in 8 days
- Disclosed after 10 days
Hi,
Any user after logging into an any myshopify shop can be redirected to other domain.
To reproduce: Send this to victim: http://sehyoginfoshop.myshopify.com/account/login?checkout_url=.np
Now when our victim logs in, He will be redirected to https://sehyoginfoshop.myshopify.com.np/
Which is not a shopify domain.
Fix: While redirecting Use <shop-name>"/"$checkout_url instead of <shop-name>$checkout_url
What the report shows
The target is the login flow of any *.myshopify.com store, specifically the account/login endpoint and its checkout_url parameter. The researcher reports that after a user logs in to any myshopify shop, the application can be made to redirect that user to a different domain.
The reproduction is a single link sent to the victim:
http://sehyoginfoshop.myshopify.com/account/login?checkout_url=.np
When the victim logs in through that page, the browser is sent to:
https://sehyoginfoshop.myshopify.com.np/
That host is not a Shopify domain. The trick is in the value .np: it is appended to the shop hostname, so the resulting host reads as sehyoginfoshop.myshopify.com.np, where .np is the country-code top-level domain. The resulting host begins with the shop name but is not a Shopify domain.
The report gives no bounty amount, no severity rating and no CVSS score. It does propose a fix, quoted here as written:
Use <shop-name>"/"$checkout_url instead of <shop-name>$checkout_url
In other words, the researcher suggests inserting a path separator between the shop hostname and the user-supplied value so that the value can no longer extend the hostname.
Root cause
The proposed fix suggests the shop hostname and the checkout_url value are joined without a separator, and the result is used as a redirect target. A value beginning with a dot turns the shop hostname into a prefix of a longer domain. The application then redirects to that domain after a successful login.
Impact
The impact described is an open redirect: a victim who logs in through a crafted link ends up on a domain that is not a Shopify domain. The report does not describe any further use of the redirect, such as credential phishing or token theft, and does not claim any specific attack chain beyond the redirection itself.
How this kind of bug works
An open redirect exists when an application takes a destination from user input and sends the browser there without validating that the destination is trusted. The classic form is a redirect, return, next or continue parameter that is used verbatim in a Location header or a client-side navigation.
The variant here is subtler. Instead of accepting a full URL, the code builds one by concatenating a trusted base with the input. If the base ends without a delimiter, input that starts with a dot or a similar character can extend the hostname rather than the path. The browser then resolves the whole string as a host, and the trusted name becomes a prefix of an attacker-registered domain. Related concatenation mistakes include input beginning with @ (userinfo in a URL), with // (protocol-relative host), or with a backslash that some parsers normalise to a slash.
Defences work at two levels. First, never build redirect targets by concatenation: parse the base URL, set the path or query component explicitly, and serialise the result. Second, restrict destinations to a known set, either relative paths only or an allow-list of hosts, and reject anything else. Redirecting only to paths on the same origin removes the class entirely.
How to test for it
- Find parameters that influence navigation: login and logout flows, checkout and basket handoffs, language and country switchers, OAuth and SSO callbacks, email confirmation links, and anything named like
url,next,return,redirect,continueorcheckout_url. - Send a value that is an absolute URL on a domain you control and observe whether the response redirects there, either in the
Locationheader or after a client-side step. - If absolute URLs are rejected, test concatenation: send a value starting with a dot, with
@, with//, and with encoded variants of each, and check whether the resulting host differs from the intended one. - Test the redirect after the state change it is tied to, for example after authenticating, since some applications only apply the parameter at that point.
- A positive result is a response or navigation that lands on a host you control, or on a host that is clearly not the application's, with the trusted name only appearing as a prefix or in userinfo.
Common false positives: a redirect that only accepts relative paths and silently falls back to the home page; a Location header pointing to the same origin with the payload reflected in the path or query; a block page that echoes the input without navigating; and client-side routers that display the value but never leave the origin. Confirm the final host in the browser, not just the presence of your string in the response.
How it is fixed
- Build redirect targets from parsed URL components rather than string concatenation, so user input can only occupy a path or query slot.
- Allow only relative paths, or validate the destination against an allow-list of hosts, and reject everything else with a safe default.
- Where a shop-specific host is constructed, insert an explicit separator and validate the resulting host against the expected pattern.
- Apply the same check on both server-side
Locationheaders and any client-side navigation that consumes the parameter.
Hunting notes
Open redirects cluster around authentication and commerce handoffs, because those flows genuinely need to send users onward and developers often accept a destination from the request. Recon signals worth watching: parameters whose names suggest a destination, redirects that fire only after login, and hosts built from a shop or tenant name where a suffix could be appended. Multi-tenant platforms are fertile ground, since the same code serves many hostnames and a small parsing slip affects all of them.
To get a report accepted, show the full chain: the crafted link, the state change (such as logging in), and the final host in the browser. Explain why the resulting domain is not the application's, and keep the demonstration on a domain you control rather than a real third party. Where the program asks for impact beyond the redirect itself, describe a plausible follow-on such as phishing on a lookalike domain, but do not claim more than you demonstrated.
What happened, in plain words
Shopify is a platform that lets anyone run an online shop. Every shop gets its own web address of the form *.myshopify.com, for example sehyoginfoshop.myshopify.com. Each shop also has a login page, where the shop's customers sign in with their account.
That login page accepts a setting called checkout_url. The idea is simple: after you log in, the shop can send you onward to a page you were heading for, such as a checkout page. The report shows that this onward destination could be pointed at a domain that is not a Shopify domain. This kind of flaw is called an open redirect: the site takes a destination from whoever sends the link and sends the visitor there without checking that the destination is trustworthy.
The researcher sent a single link to a victim:
http://sehyoginfoshop.myshopify.com/account/login?checkout_url=.np
Let us take it apart, piece by piece:
http://is the scheme, telling the browser to speak the ordinary web protocol.sehyoginfoshop.myshopify.comis the shop's own address, the part the victim recognises and trusts./account/loginis the path to the shop's login page.?starts the query string, a list of settings passed to the page.checkout_url=.npis one such setting: the namecheckout_urland the value.np.
.np is the country-code top-level domain for Nepal, the ending of web addresses registered there. On its own it is harmless. The problem is what the shop does with it.
When the victim opens the link, they see a normal login page on the shop's own address and sign in. After a successful login, the browser is sent to:
https://sehyoginfoshop.myshopify.com.np/
Read that address carefully. It is not myshopify.com. It is myshopify.com.np, a domain ending in .np. The shop's real name has simply been glued to the front, so the address begins with the familiar words but is not a Shopify domain. The report states plainly that this is not a Shopify domain.
The report gives no bounty amount, no severity rating and no CVSS score. It does suggest a fix, quoted here as written:
Use <shop-name>"/"$checkout_url instead of <shop-name>$checkout_url
In plain terms: put a slash between the shop's address and the visitor-supplied value. With a slash in place, the value can only become part of the path (the part after the address), never part of the address itself.
Why it works
The suggested fix implies the shop's address and the checkout_url value are joined together with no separator between them, and the result is used as the place to send the visitor. Because nothing forces the value into a path, a value that starts with a dot simply continues the address. The trusted shop name becomes the beginning of a longer domain.
What the impact is
The victim clicks a link that looks like their shop, logs in on the real shop, and then lands on a domain that is not a Shopify domain. The report describes only this redirection. It does not describe any further use of it, such as stealing passwords or session data, and it does not claim any larger attack chain.
In general, how this kind of bug works
An open redirect happens when a website takes a destination from the request and sends the browser there without checking that the destination is trusted. The usual shape is a setting named something like redirect, return, next or continue, whose value is used as-is when the site tells the browser where to go next.
The variant in this report is subtler. The site does not accept a whole address; it builds one by sticking a trusted base and the input together. If the base does not end with a separator such as a slash, input that starts with a dot can extend the address instead of the path. The browser then treats the whole string as an address, and the trusted name becomes a prefix of an attacker's domain. Similar mistakes appear when input starts with @ (which can mark a username inside an address), with // (which can start a new address), or with a backslash that some software treats like a slash.
There are two levels of defence. First, never build a destination by gluing strings: take the trusted address apart, set only the path or query part from the input, and put it back together. Second, limit destinations to a known set, either paths on the same site only, or a list of approved hosts, and refuse everything else. Allowing only paths on the same site removes the problem entirely.
In general, how to test for it
- Look for settings that influence where you go next: login and logout, checkout and basket handoffs, language and country switchers, sign-in callbacks, confirmation links, and anything named like
url,next,return,redirect,continueorcheckout_url. - Send a full address on a domain you control and see whether the site sends you there, either directly or after a step in the browser.
- If full addresses are refused, test the gluing: send a value starting with a dot, with
@, with//, and encoded versions of each, and check whether the resulting address differs from the intended one. - Test after the action the redirect belongs to, for example after logging in, because some sites only apply the setting at that moment.
- A positive result is landing on a host you control, or on a host that is clearly not the site's, with the trusted name appearing only at the front or inside the address.
Watch for false positives: a redirect that only accepts paths on the same site and quietly falls back to the home page; a destination on the same site with your text reflected in the path; a block page that shows your input without navigating; and browser-side code that displays the value but never leaves the site. Confirm the final address in the browser, not just the presence of your text in the response.
In general, how it is fixed
- Build destinations from parsed address parts rather than glued strings, so input can only fill a path or query slot.
- Allow only paths on the same site, or check the destination against a list of approved hosts, and refuse everything else with a safe default.
- Where a shop-specific address is built, insert an explicit separator and check the result against the expected pattern.
- Apply the same check both where the server sends the browser onward and wherever browser-side code uses the setting.
In general, where to look
Open redirects cluster around sign-in and shopping handoffs, because those flows genuinely need to send people onward and it is easy to accept a destination from the request. Useful signals: setting names that suggest a destination, redirects that only fire after login, and addresses built from a shop or tenant name where an ending could be appended. Platforms that serve many shops from the same code are good ground, since one small slip affects every shop.
To get a report accepted, show the whole chain: the crafted link, the action such as logging in, and the final address in the browser. Explain why that address is not the site's, and keep the demonstration on a domain you control rather than a real third party. If the programme asks for impact beyond the redirect, describe a plausible follow-on such as phishing on a lookalike domain, but do not claim more than you demonstrated.
Glossary
- Open redirect: a flaw where a site sends visitors to a destination taken from the request without checking that it is trusted.
- Endpoint: a specific address on a site that performs a particular action, here the login page.
- Parameter: a named setting passed in a web address after the
?, such ascheckout_url. - Query string: the part of a web address after
?that carries parameters. - Host / hostname: the part of a web address that names the server, such as
sehyoginfoshop.myshopify.com. - Domain: a registered name on the internet, such as
myshopify.com. - Top-level domain (TLD): the ending of a domain, such as
.comor the country code.np. - Path: the part of a web address after the hostname, such as
/account/login. - Scheme: the beginning of a web address that names the protocol, such as
http://orhttps://. - String concatenation: joining two pieces of text end to end to make one longer piece.
- Redirect: an instruction from a site telling the browser to go to another address.
- Location header: the part of a server's reply that carries a redirect destination.
- Allow-list: a list of approved values, with everything else refused.
- Same origin: the same scheme, host and port, meaning the same site for security purposes.
- False positive: a test result that looks like a problem but is not one.
- CVSS: a standard scoring system for rating the severity of a security flaw.
- Phishing: tricking someone into entering details on a lookalike site.