Improper access control on adding a Register to an Outlet
A user with the Cashier role, who lacks permission to add registers, could bypass this by creating their own store and then modifying the outlet ID in the request to target an outlet in another store. This allowed the attacker to add a register to an outlet they should not have access to.
- Triaged in 4 days
- Fixed in 35 days
- Disclosed after 2 months
Summary: User without permissions to add a Register to an Outlet can bypass this restriction and add a Register to an Outlet.
Description: I do not know which permission exactly controls this action, I tested this against default Cashier role. User with default Cashier role has no permission to add registers. If a user creates his own store on vendhq.com then he can add a Register to an Outlet.
Steps To Reproduce:
- Add a user to store A with
Cashierrole. Assume the added user's email is [email protected] - Go to
Setup->Outlets and Registers - Create an outlet in store A
- Create a new store B using email [email protected]
- Log in to store B with [email protected] credentials
- Create an outlet in store B
- Run Burp Suite or any other proxy to intercept requests
- Add a register to outlet in store B and intercept outgoing POST request
- Replace id in
vend_register%5Boutlet_id%5D=<outlet id>from the request with id of outlet from store A and process the request - Check outlet from store A - a register should be added to it
Request example
POST /register/create/outlet_id/<outled id from B> HTTP/1.1
Host: <store B>.vendhq.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://<store B>.vendhq.com/register/<outled id from B>/new?confirmed=1
Content-Type: application/x-www-form-urlencoded
Content-Length: 694
Cookie: <Cookie>
DNT: 1
Connection: close
Upgrade-Insecure-Requests: 1
vend_register%5Bid%5D=&vend_register%5Boutlet_id%5D=<outled id from A>&vend_register%5B_csrf_token%5D=<csrf token>&vend_register%5Bname%5D=6&vend_register%5Bcash_managed_payment_id%5D=<cash managed payment id>&vend_register%5Breceipt_template_id%5D=<receipt template id>&vend_register%5Binvoice_sequence%5D=1&vend_register%5Binvoice_prefix%5D=&vend_register%5Binvoice_suffix%5D=&vend_register%5Bask_for_user_on_sale%5D=0&vend_register%5Bemail_receipt%5D=1&vend_register%5Bprint_receipt%5D=1&vend_register%5Bask_for_note_on_save%5D=1&vend_register%5Bprint_note_on_receipt%5D=1&vend_register%5Bshow_discounts%5D=1&return=
Cashier can get id of interesting outlet from Sales Ledger page source.
Impact
An attacker can add registers to outlets even if he has no permissions to do it.
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 did not verify that the outlet ID in the request belonged to the user's store, allowing cross-store manipulation.
Impact
An attacker could add registers to outlets even without having the necessary permissions.
What the attacker needed
A user account with Cashier role; ability to create a new store; ability to intercept HTTP requests
How it was found
- Add a user with Cashier role to store A.
- Create an outlet in store A.
- Create a new store B using the same user's email.
- Log in to store B and create an outlet there.
- Intercept the request to add a register to the outlet in store B.
- Replace the outlet ID in the request with the ID of the outlet from store A and send it.
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.
This is a case where the website checked what you were allowed to do in your own store, but did not check whether the outlet you were adding a register to actually belonged to you. By changing a number in the request, an attacker could add a register to someone else's outlet.
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.