Skip to content
Access control Write-up Beginner

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.

Rahimahaq, on medium.com

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

  1. Create a normal user account on the application.
  2. Go to the Settings section and click the Admin View option.
  3. A password prompt appears; try brute-force and response manipulation, which fail.
  4. Analyse the JavaScript files and search for keywords such as admin.
  5. Find a hardcoded admin password in a JavaScript file.
  6. 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.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.