Skip to content
Access control Disclosed report Intermediate

Undocumented `fileCopy` GraphQL API

An undocumented GraphQL mutation called fileCopy let a staff account with no file permissions copy a file from a store they controlled into the store where they were staff. This bypassed the permission restriction that should have stopped them uploading files.

ash_nz Follow

Originally disclosed on HackerOne

Bounty$2,000 Medium 4.2 View original
  • Disclosed after 39 days

Impact

A malicious staff account with no permissions can copy other store file assets to current store, which they have no access to.

Details

So the story as follow A malicious staff member (jack_mccracken) on storeA.myshopify.com wants to upload a file on the store but could not, due to permissions restrictions. So jack_mccracken decided to find a way to bypass the restriction so he created a new store called storeB.myshopify.com and uploaded a file on storeB.

jack_mccracken is a skilled attacker he found an undocumented GraphQL API called fileCopy, he used this API to try to copy a file from his store StorB to StoreA (where he is a staff member).

He login into StoreA (as staff member) and send the following request:

HTTP
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"
}
}

the variables absoluteKey key and pathvalues are the values of the file he uploaded in his store storeB

THE END

Impact

A malicious staff account with no permissions can copy other store file assets to current store, which they have no access to.

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the fileCopy GraphQL mutation did not check the caller's file permissions before copying an asset into the store.

Impact

A staff account with no file permissions could copy file assets into a store, bypassing the intended access restriction.

What the attacker needed

A staff account with no file permissions; a second store the attacker controls

How it was found

  1. Create a second store and upload a file there.
  2. Log in to the target store as a staff member without file permissions.
  3. Send a fileCopy GraphQL mutation using the key, absolute key and path of the file from the second store.
  4. The file is copied into the target store despite the missing permissions.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A store has staff accounts with limited permissions, and this one was not allowed to upload files. The attacker made their own separate store, uploaded a file there, then used a hidden feature of the store's programming interface to copy that file into the store where they worked. The hidden feature did not check whether the person was allowed to add files, so the restriction was bypassed.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by ash_nz

View all

2 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.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.