Stocky App Administrator can create a backdoor admin account by using an existing POS User
A staff member with the Stocky app's Administrator role could reach an edit page for POS users that the interface does not expose, change the user's email, and add an admin flag to the saved request. This let them turn an existing POS user into a hidden admin account they could use later, though access still required the Stocky app permission.
Originally disclosed on HackerOne
- Triaged in 18 hours
- Fixed in 5 days
- Paid in 19 hours
- Disclosed after 5 days
Details
The Stocky App has POS Users that are being created once a POS Staff logs in into the application from the Point Of Sale application on a mobile device.
From the users management page located at https://stocky.shopifyapps.com/users there's no visible way to edit those POS users. Although, it is possible to edit them by inspecting their user id from the delete button and then opening https://stocky.shopifyapps.com/users/{user_id}/edit endpoint. Furthermore, you can even make that user an admin by adding user[admin] to the request being sent once you save their profile. As the UI doesn't show an admin column for POS users, it becomes a bit transparent to any other admins that a POS User does have an actual account and what roles he's assigned to.
The thing is that to access the Stocky APP, it requires an actual staff member with the App permission so this is reducing the impact here. Still, that flaw could be abused by a Staff Member whom was granted once the Administrator role within the app and took the opportunity to create a backdoor admin user from an already existing POS user and/or creating one for himself if he also had access to the Point Of Sale app. He could then be using that backdoor account at some point later if he does lose its Administrator role from the app (assuming he still has the App permission).
Steps to reproduce
- From the Point Of Sale mobile application, open the Stocky Application with a POS User. (This is to create a POS User into the Stocky App - not sure if there's any other way)
- As a Staff Member with Stocky App
Administratorpermission, open https://stocky.shopifyapps.com/preferences/users and inspect the user ID of that POS User by mouse hovering its delete button. - Open
https://stocky.shopifyapps.com/users/{user_id}/editby taking care of replacing the{user_id}placeholder with the one from previous step - Set an email address field to an email that you own, so you can actually use it to set the account password. To make it real the attacker user could be creating one with the actual POS User Firstname/LastName so it looks more real.
- Intercept the request once you save the profile and add
user[admin]=1to the payload
The POS user now has an actual account he can use to login as an admin (Still requires Stocky App permission).
Demo (Step 1 excluded)
Impact
Create a backdoor admin user from a POS user account
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 server trusted a client-supplied admin field on the profile update and did not restrict editing of POS-created users to the intended interface.
Impact
A staff member who held the Administrator role could create a hidden admin account to keep access after losing that role, but only while they still had the Stocky app permission.
What the attacker needed
Stocky Administrator permission; Stocky app permission retained; Access to the point-of-sale app
How it was found
- Log in to the Stocky app from the point-of-sale mobile app as a POS user, which creates that POS user in Stocky.
- As a staff member with Stocky Administrator permission, open the users preferences page and find the POS user's ID from the delete button.
- Open the user edit URL directly, replacing the placeholder with that ID.
- Change the email field to an address the attacker controls so a password can be set.
- Intercept the save request and add the admin parameter to the payload.
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.
Some users in this app are created automatically when staff log in from a point-of-sale device, and the normal user screen gives no way to edit them. The report shows that the edit page for those users still exists and can be opened directly, and that the save request accepts an extra field marking the user as an administrator. So someone who already had admin rights could quietly give an ordinary POS user admin rights too.
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.