Skip to content
Path traversal Disclosed report Intermediate

Path Traversal in App Proxy

The Shopify app proxy did not properly sanitise path traversal sequences, allowing an attacker to escape the intended proxy path and access arbitrary paths on the OAuth app's backend host. An anonymous user could reach unintended locations on the app's server.

ngalog Follow

Originally disclosed on HackerOne

Medium 6.8 View original
  • Triaged in 6 days
  • Fixed in 29 days
  • Paid in 10 days
  • Disclosed after 4 months

Hi,

I found app proxy is vulnerable to path traversal, the attacker scenario is from anonymous user to oauth app owner.

Description

In app proxy function, it is possible proxy request to shopify custom domain request to oauth app store defined host, and because shopify didn't escape the ../, it allows anyone to escape the path and reach unintended location.

Steps to reproduce

  • Since setting up and explaining how to setup app proxy would be so trouble, I'll go straight to the point.
  • The app proxy for my oauth app is set to https://████████/proxy, path and subpath is apps/ss
  • My store █████ has installed it
  • If you go https://███████/apps/ss/test, you should see hi im ron, which matches https://██████████/proxy/test
  • In theory, you can't use this proxy to see what's hosting in https://████████/ since I have added /proxy in the path
  • However with this path traversal, it is possible now

Copy and paste this to the burp repeater and hit Send

GET /apps/ss/b.php/../../?shop=a&Shop=asd HTTP/1.1
Host: ███████
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:75.0) Gecko/20100101 Firefox/75.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Upgrade-Insecure-Requests: 1


response is

	<head>
<meta name=dropbox-domain-verification content=4yyz8tdqnx1e />
</head>


<body>hi</body>


Which matches response at https://█████/

Impact

Able to perform path traversal on oauth app as anonymous user

The original report as published on HackerOne, by ngalog. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

Shopify lets merchants install OAuth apps that extend a storefront. One of the mechanisms for that is the app proxy: a storefront URL under the shop's own custom domain is forwarded to a host defined by the app, so the app's content appears to be served from the shop's domain. In the researcher's setup, the proxy target is https://████████/proxy and the path and subpath is apps/ss.

The report describes a path traversal in this proxy, rated medium (CVSS 6.8). The scenario the researcher describes runs from an anonymous user to the owner of an OAuth app: the anonymous visitor sends a crafted request to the shop's domain, and the proxy forwards it somewhere the app owner did not intend to expose.

Setup

The researcher's own OAuth app is used as the target of the proxy. Its app proxy is configured as follows:

  • Proxy target: https://████████/proxy
  • Path and subpath: apps/ss

The researcher's store █████ has the app installed. No other tooling is described beyond Burp Repeater, which is used to send the crafted request.

Finding it

The researcher starts from the normal behaviour of the proxy. A request to the shop domain under the configured subpath is forwarded to the app host under the configured prefix. With the proxy pointing at https://████████/proxy and the subpath apps/ss, a request to:

Text
https://███████/apps/ss/test

returns hi im ron, which matches what is served at:

Text
https://██████████/proxy/test

In theory the /proxy prefix in the configured path should confine the proxy to that directory on the app host: a visitor should not be able to reach anything hosted at https://████████/ outside /proxy. The researcher found that the proxy does not escape ../ in the incoming path, so a visitor can climb out of the configured prefix and reach an unintended location on the app host.

Exploitation

Step 1: send a traversal request through the proxy

The researcher pastes the following request into Burp Repeater and sends it:

HTTP
GET /apps/ss/b.php/../../?shop=a&Shop=asd HTTP/1.1
Host: ███████
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:75.0) Gecko/20100101 Firefox/75.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Upgrade-Insecure-Requests: 1

The path begins with the configured subpath apps/ss. It then contains b.php/../../, which walks back up out of the path the proxy appends to the target host. The query string carries shop=a&Shop=asd.

Step 2: read the response

The response is:

Text
	<head>
<meta name=dropbox-domain-verification content=4yyz8tdqnx1e />
</head>

<body>hi</body>

This response matches what is served at https://█████/, the root of the app host, rather than anything under the configured /proxy prefix. The traversal therefore let an anonymous visitor reach content outside the directory the app owner had exposed through the proxy.

Root cause

The proxy takes the path from the incoming storefront request and appends it to the configured target host and prefix. Because the ../ sequences in that path are not escaped or normalised away, the appended path can climb out of the configured prefix and resolve to a different location on the app host. The report does not describe the server-side implementation. The report does not describe the server-side implementation, so the exact place where normalisation should have happened is not stated.

Impact

As the researcher puts it, an anonymous user is able to perform path traversal on an OAuth app. The condition is that the app has an app proxy configured, and the reachable content is whatever is hosted on the app's target host outside the configured prefix. In this case the traversal reached the root of the app host and returned content matching https://█████/. The report does not enumerate further consequences beyond reaching unintended locations on the app host.

Fix

Variants to test

  1. Encode the traversal: try %2e%2e%2f, double encoding, and mixed encodings in place of ../ to see whether a filter that only looks for the literal sequence can be bypassed. A positive result is a response from outside the configured prefix.
  2. Vary the depth: add more ../ segments to climb further up the target host's path. A positive result is content from a directory higher than the one reached with a single pair.
  3. Place the traversal at different positions in the path, before and after a file-like segment such as b.php/, to see which forms the proxy forwards without normalising. A positive result is any response that does not correspond to the configured prefix.
  4. Compare the proxied response with the direct response from the app host root, as the researcher did, to confirm the traversal actually reached the other location rather than returning a cached or default page.

Hunting notes

App proxy style features are worth checking wherever a platform forwards requests from a customer-controlled domain to a host chosen by an app developer, because the configured path prefix is often the only thing separating the exposed directory from the rest of the app host. During recon, an app proxy configuration with a path prefix such as /proxy is the signal: the question is whether the prefix survives a path containing ../. The researcher demonstrated impact by showing that the proxied response matched the app host root, and framed the scenario as anonymous user to OAuth app owner.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

Shopify is a platform that lets people run online shops. Shops can add extra features by installing apps, which are small programs written by other companies. One way an app can show content on a shop is called the app proxy. Instead of sending visitors to the app company's own website, the shop's website quietly fetches the content from the app company and shows it as if it came from the shop's own address. This keeps the visitor on the shop's domain, which looks tidy and trustworthy.

In this setup the app proxy has a target host and a path prefix: the target is https://████████/proxy and the path and subpath is apps/ss. The researcher found that this boundary could be crossed. By putting ../ in the address, a visitor could climb out of the allowed folder and reach other content on the app company's server. The report rates this as medium severity with a CVSS score of 6.8, and describes the scenario as going from an anonymous visitor to the owner of an OAuth app.

Background concepts, from zero

Before the steps make sense, here are the ideas involved.

  • Domain: the address you type in a browser, like example.com. A shop on Shopify can use its own custom domain, so visitors see the shop's name rather than a Shopify address.
  • Server: the computer somewhere on the internet that stores a website's files and sends them to visitors when asked.
  • Path: the part of a web address after the domain, like /proxy/test. It works like folders on your computer: /proxy is a folder, and /proxy/test is a file or page inside it.
  • App proxy: a feature where one website forwards a request to another website and passes the answer back. Think of a receptionist who takes a message for a colleague in another office and brings back the reply. The visitor only talks to the receptionist (the shop), but the actual work happens elsewhere (the app company).
  • OAuth app: an app that a shop owner authorises to access their shop. The owner grants permission once, and the app can then act on the shop's behalf. The person who owns and configures such an app is the "OAuth app owner" in this report.
  • Path traversal: a vulnerability where a user can use ../ to move out of the folder they are supposed to be limited to. On a computer, ../ means "go up one folder". If a website lets you put ../ into a path without cleaning it up, you can walk up out of the intended folder and into others. It is like being told you may only look in drawer A, but finding that the label on the drawer can be rewritten to say "go to the room next door".
  • Escaping or normalising: cleaning up a path before using it. Normalising means turning a/b/../c into a/c, so the .. is resolved and cannot surprise anyone later. Escaping means making the special characters harmless, for example by encoding them so they are treated as plain text rather than as instructions to move up a folder.
  • Burp Repeater: a tool that lets you write a raw web request by hand, send it, and look at the exact response. It is useful when you want to change one small part of a request and see what happens, which a normal browser makes awkward.
  • Query string: the part of a web address after a ?, made of name and value pairs like shop=a. It carries extra information to the server.
  • HTTP request and response: when your browser asks a server for a page, it sends a request with a method (like GET), a path, a host, and some headers. The server answers with a response containing the page content.
  • Headers: extra lines in a request or response that describe it, such as the browser type (User-Agent) or what content types are accepted (Accept).

The setup

The researcher used their own OAuth app as the target. The app proxy was configured like this:

  • Proxy target: https://████████/proxy
  • Path and subpath: apps/ss

The researcher's store █████ had the app installed. The only tool mentioned for sending requests is Burp Repeater.

In plain terms: the shop's address would accept requests under apps/ss, and forward them to the app company's server, inside the /proxy folder. The /proxy folder was meant to be the only part of the app company's server that visitors could reach through the shop.

Finding it

The researcher first checked how the proxy behaves normally. A request to the shop's domain under the configured subpath is forwarded to the app host under the configured prefix. With the proxy pointing at https://████████/proxy and the subpath apps/ss, a request to:

Text
https://███████/apps/ss/test

returns hi im ron, which matches what is served at:

Text
https://██████████/proxy/test

Why this step matters: it confirms the proxy is working as designed. The page test on the shop's address shows the same content as test inside the /proxy folder on the app company's server. That gives a baseline. If a later request returns something different, the difference is caused by the change, not by the proxy being broken.

In theory, the /proxy prefix should keep visitors inside that folder. A visitor should not be able to reach anything at https://████████/ outside /proxy. The researcher found that the proxy does not escape ../ in the incoming path, so a visitor can climb out of the configured prefix and reach an unintended location on the app host.

Exploitation

Step 1: send a traversal request through the proxy

The researcher pastes the following request into Burp Repeater and sends it:

HTTP
GET /apps/ss/b.php/../../?shop=a&Shop=asd HTTP/1.1
Host: ███████
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:75.0) Gecko/20100101 Firefox/75.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Upgrade-Insecure-Requests: 1

Line by line, in plain words:

  • GET /apps/ss/b.php/../../?shop=a&Shop=asd HTTP/1.1 is the request line. GET means "give me this page". The path is /apps/ss/b.php/../../, and the query string is shop=a&Shop=asd. The HTTP/1.1 is the version of the web protocol being used.
  • Host: ███████ tells the server which website the request is for. A single server can host many websites, so this line picks the right one.
  • User-Agent: ... says which browser is making the request. Here it is a Firefox on a Mac. Servers sometimes change their behaviour based on this, so it is included to look like a normal browser.
  • Accept: ... lists the kinds of content the browser is willing to receive, such as HTML pages and images.
  • Accept-Language: en-US,en;q=0.5 says the browser prefers English.
  • Accept-Encoding: gzip, deflate says the browser can accept compressed responses, which saves bandwidth.
  • Upgrade-Insecure-Requests: 1 asks the server to use a secure connection if possible.
  • The blank line at the end marks the end of the headers. After it, a request could carry a body, but this one does not.

Why this request: the path starts with the configured subpath apps/ss, so the proxy accepts it as a request meant for the app. Then comes b.php/../../. The b.php part looks like a file, and the ../../ walks back up out of the path the proxy appends to the target host. The query string shop=a&Shop=asd is carried along. The researcher is testing whether the proxy cleans up the ../ before forwarding, or passes it through untouched.

Step 2: read the response

The response is:

Text
	<head>
<meta name=dropbox-domain-verification content=4yyz8tdqnx1e />
</head>

<body>hi</body>

This response matches what is served at https://█████/, the root of the app host, rather than anything under the configured /proxy prefix. The traversal therefore let an anonymous visitor reach content outside the directory the app owner had exposed through the proxy.

Why this matters: the response is not the hi im ron page from inside /proxy. It is a different page, one that lives at the top level of the app company's server. The response matches what is served at https://█████/, the root of the app host, rather than anything under the configured /proxy prefix.

Root cause

The proxy takes the path from the incoming storefront request and appends it to the configured target host and prefix. Because the ../ sequences in that path are not escaped or normalised away, the appended path can climb out of the configured prefix and resolve to a different location on the app host. The report does not describe the server-side implementation.

In everyday terms: the receptionist is told "anything a visitor asks for, look for it in the /proxy folder". But the visitor can write "go up two folders" on the note, and the receptionist follows that instruction without checking whether the result is still inside /proxy. The rule was about where to start looking, not about where the search must end.

The report does not describe the server-side implementation, so the exact place where normalisation should have happened is not stated.

Impact

As the researcher puts it, an anonymous user is able to perform path traversal on an OAuth app. The condition is that the app has an app proxy configured, and the reachable content is whatever is hosted on the app's target host outside the configured prefix. In this case the traversal reached the root of the app host and returned content matching https://█████/. The report does not enumerate further consequences beyond reaching unintended locations on the app host.

In plain words: anyone on the internet, without logging in, could use a shop's address to peek at parts of the app company's server that the app owner never meant to expose through the proxy.

Fix

In everyday terms: before following the note, the receptionist should rewrite "go up two folders" into the final folder name, check that the final folder is still inside /proxy, and refuse the request if it is not.

Variants to test

These are follow-up ideas for someone testing a similar feature. Each one changes a small part of the request and looks for the same sign: a response that does not belong to the configured prefix.

  1. Encode the traversal: try %2e%2e%2f, double encoding, and mixed encodings in place of ../ to see whether a filter that only looks for the literal sequence can be bypassed. A positive result is a response from outside the configured prefix. Encoding is a way of writing a character using a code, so %2e means a dot and %2f means a slash. A filter that only checks for the plain text ../ might miss the encoded form.
  2. Vary the depth: add more ../ segments to climb further up the target host's path. A positive result is content from a directory higher than the one reached with a single pair.
  3. Place the traversal at different positions in the path, before and after a file-like segment such as b.php/, to see which forms the proxy forwards without normalising. A positive result is any response that does not correspond to the configured prefix.
  4. Compare the proxied response with the direct response from the app host root, as the researcher did, to confirm the traversal actually reached the other location rather than returning a cached or default page. A cache is a stored copy of a page kept to answer future requests faster, and a default page is what a server shows when it has nothing specific to show. Either could look like a successful traversal when it is not.

Hunting notes

App proxy style features are worth checking wherever a platform forwards requests from a customer-controlled domain to a host chosen by an app developer, because the configured path prefix is often the only thing separating the exposed directory from the rest of the app host. During recon, an app proxy configuration with a path prefix such as /proxy is the signal: the question is whether the prefix survives a path containing ../. The researcher demonstrated impact by showing that the proxied response matched the app host root, and framed the scenario as anonymous user to OAuth app owner.

In plain words: whenever you see a feature that passes requests from one website to another, look at the folder it is supposed to stay inside, and ask whether a ../ in the address can take you out of it. The strongest proof is a response that matches a page you know lives outside that folder.

Glossary

  • App proxy: a Shopify feature that forwards requests from a shop's domain to a host chosen by an app, so the app's content appears under the shop's address.
  • Anonymous user: a visitor who is not logged in and has no account or session.
  • Burp Repeater: a tool for writing a raw HTTP request by hand, sending it, and inspecting the exact response.
  • Cache: a stored copy of a response kept so future requests can be answered faster.
  • CVSS: a scoring system that rates the severity of a vulnerability, here 6.8, described as medium.
  • Domain: the address of a website, such as example.com.
  • Encoding: writing a character using a code, such as %2e for a dot, so it can be carried safely in a web address.
  • Escaping: making special characters harmless, for example by encoding them so they are treated as plain text.
  • GET: the HTTP method used when a browser asks a server for a page.
  • Header: an extra line in an HTTP request or response describing it, such as the browser type or accepted content types.
  • Host: the server that stores a website's files and answers requests for it.
  • HTTP: the protocol browsers and servers use to exchange requests and responses.
  • Normalising: cleaning up a path so that .. segments are resolved, turning a/b/../c into a/c.
  • OAuth app: an app that a shop owner authorises to access their shop, acting on the shop's behalf after permission is granted.
  • Path: the part of a web address after the domain, such as /proxy/test.
  • Path prefix: the leading part of a path, such as /proxy, used here as the folder the proxy is allowed to reach.
  • Path traversal: a vulnerability where ../ in a path lets a user climb out of the folder they are meant to be limited to.
  • Query string: the part of a web address after ?, made of name and value pairs such as shop=a.
  • Recon: the early stage of testing where you look for features and configurations worth examining.
  • Response: what a server sends back after a request, containing the page content and headers.
  • Root: the top level of a server's path, written as /, above all folders.
  • Subpath: a path segment configured for the proxy, here apps/ss, that marks requests meant for the app.
  • Target host: the address of the app company's server that the proxy forwards requests to.
  • User-Agent: a request header that says which browser and operating system are making the request.

More by ngalog

View all

21 more disclosed reports, best first.

More from Shopify

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.