Honey, did you leave the APIs open again?
The eCommerce backend API lacked proper authorization checks on several endpoints, allowing an attacker to issue refunds, read and overwrite all promo codes, and read and overwrite all service orders. The attacker could also create arbitrary discounts and tamper with orders sent to third-party vendors.
Hola Amigos, I want to cover a couple of broken access control bugs I found somewhat recently in a program that got me several bounties. These were pretty simple in their nature but had some nuances in the ways I found each one so I wanted share some tricks and my thought process during the discovery.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the API endpoints lacked authorization checks, allowing unauthenticated or low-privileged users to perform sensitive operations.
Impact
An attacker could issue refunds, create arbitrary discounts, and modify service orders, potentially causing financial loss and operational disruption.
What the attacker needed
Access to the ecom.shop.com subdomain; a valid session cookie from shop.com; knowledge of endpoint names
The fix
The vulnerabilities were fixed at separate points in time, as mentioned in the text.
How it was found
- Discover the ecom.shop.com subdomain and obtain a 401 error with 'Missing Header: Authorization'.
- Use the main site's cookie as an OAuth token in the Authorization header to gain access to the API.
- Fuzz the API with FFUF using a wordlist and find the 'backup' directory containing HTML files.
- Identify the /v2/issueRefund endpoint from an HTML file and send a POST request with agent and orderNumber parameters to issue a refund.
- Fuzz further and notice a discrepancy in response length for /v1/promo, then use an empty id parameter to retrieve all promo codes.
- Send a POST request to overwrite a promo code with arbitrary data, and similarly discover and overwrite service orders via /v1/serviceorder.
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 write-up has not been written yet. The Original tab links to the source.
The website's backend API did not check whether the person making a request was allowed to do so. By guessing endpoint names and sending requests with missing or empty parameters, the attacker could perform actions like refunding orders or changing discount codes without permission.
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.