How I Hacked Into One Of Indias Biggest Online Book Stores Rce And More
The report describes multiple vulnerabilities on an online bookstore, including reflected XSS via an 'errmsg' parameter, SQL injection in an admin login leading to admin panel access, unrestricted file upload enabling RCE, price manipulation via negative quantity, CSRF, and an OTP authentication bypass by changing a response code. An attacker could gain admin access, execute code, tamper with orders, and access customer data.
This article is going to be about how I found my 1st RCE on one of India’s biggest e-commerce sites(+ a few more bugs).
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 multiple root causes: unsanitised user input reflected in error messages, improper input validation in SQL queries, insufficient file upload restrictions, lack of server-side validation for quantity, missing CSRF tokens, and client-side only OTP verification.
Impact
An attacker could gain admin access, execute arbitrary code on the server, tamper with orders and prices, access private customer information, and bypass OTP authentication, potentially leading to data leakage and website defacement.
What the attacker needed
Access to the website; knowledge of the 'errmsg' parameter; ability to intercept HTTP responses
The fix
The vulnerabilities were fixed by the vendor, as indicated by the patched date.
How it was found
- Enter a wrong password to see the error message reflected from the 'errmsg' parameter.
- Replace the error message with an XSS payload to confirm reflected XSS.
- Use waybackurls to find other pages using the 'errmsg' parameter, including a secret admin login page.
- Attempt SQL injection on the admin login form using POST requests, first with a single quote to trigger an error, then with a bypass payload.
- Access the admin panel and navigate to the blog edit section to test file upload.
- Upload a file with a mixed-case '.PhP' extension to achieve remote code execution.
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.
This write-up shows several common web security mistakes. The author found that user input was echoed back without cleaning (cross-site scripting), that a login form could be tricked with a database command (SQL injection), and that file uploads were not properly checked, allowing a malicious file to run on the server. These flaws let an attacker take over the admin panel and even run their own code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.