Hacking a pharmacy to get free prescription drugs and more
Insecure super admin APIs on Dava India Pharmacy's website allowed unauthenticated access to a list of super admin users and the ability to create a new super admin account. An attacker could then control the entire pharmacy backend, including orders, products, coupons, and prescription requirements.
eaton-works.com
Published on eaton-works.com
My first disclosure in the healthcare industry has arrived! Ever wondered what it would be like to gain administrative access to a major pharmacy?
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 missing authentication and authorization checks on the super admin API endpoints, allowing unauthenticated users to list and create super admin accounts.
Impact
An attacker could gain full control of the pharmacy backend, including viewing nearly 17,000 orders with customer information, editing over 1,500 products (including removing prescription requirements), creating 100% off coupons, and changing website content.
What the attacker needed
No account needed; access to the admin subdomain
The fix
The issue was fixed by Dava India in a little under a month after being reported.
How it was found
- Find the admin subdomain and inspect its client-side JavaScript.
- Access the super admin user listing endpoint without authentication.
- Send a POST request to the same endpoint to create a new super admin account, adding missing fields one by one.
- Use the password reset function to set a password for the new account.
- Log in with the new super admin credentials.
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 pharmacy's admin website had a programming interface (API) that was supposed to be used only by trusted administrators. However, it did not check who was making the request, so anyone could use it to list existing admins and even create a new admin account. Once an attacker had admin access, they could see customer orders, change product prices, and create discount coupons.
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.