Unauthorized Admin Panel Access via JavaScript Recon
A hardcoded admin password was exposed in a JavaScript file, allowing any user to enter it in a password prompt and gain full admin access.
medium.com
Published on medium.com
This is Rahima, a Bug Bounty Hunter and Jr. Penetration Tester.
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 application stored an admin password in client-side JavaScript instead of keeping it on the server.
Impact
An attacker could gain full admin access to the application.
What the attacker needed
A free user account; access to the Settings section
How it was found
- Create a normal user account on the application.
- Go to the Settings section and click the Admin View option.
- A password prompt appears; try brute-force and response manipulation, which fail.
- Analyse the JavaScript files and search for keywords such as admin.
- Find a hardcoded admin password in a JavaScript file.
- Enter the password in the prompt to gain full admin access.
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 code included a secret password for the admin area, and anyone could find it by reading the JavaScript files that the browser downloads. By entering that password, a normal user could become an admin.
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.