How I Found a Secret Admin Panel in the JavaScript Source Code
An admin panel was placed at an unpredictable URL but its path was embedded in client-side JavaScript served to every visitor. Anyone reading the page source could learn the admin URL and reach the panel without authorisation.
medium.com
Published on medium.com
The lab challenge was clear: "This lab has an unprotected admin panel at an unpredictable location. Find it and delete the user 'carlos’." This is a classic case of security through obscurity where developers hide functionality rather than properly securing it.
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 admin panel relied on an unguessable URL for protection while the URL itself was exposed in client-side JavaScript, with no server-side authorisation check.
Impact
Any visitor could discover the admin URL from the page source and reach unprotected admin functionality, such as deleting a user.
What the attacker needed
None
The fix
The admin panel should be protected by server-side authorisation checks rather than relying on a hidden URL, and the path should not be exposed in client-side code.
How it was found
- Check robots.txt, which returned an error.
- Browse the site manually and try common admin paths, none of which worked.
- Open the page source and read the JavaScript.
- Find the admin path referenced in the script.
- Visit that path to reach the admin panel.
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.
Some sites try to hide sensitive pages by giving them a hard-to-guess address instead of checking who is allowed in. Here the address was written into a script that every visitor downloads, so hiding it did nothing. Anyone who opened the page source could read the address and go straight to the admin area.
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.