JavaScript leads to Admin
A JavaScript file containing admin JWTs and third-party tokens was accessible after bypassing a 401 response by inserting a directory path. An attacker could obtain these credentials and potentially gain administrative access.
infosecwriteups.com
Published on infosecwriteups.com
I hope my bug bounty write-ups are helpful and easily understandable for you, even though you’re a beginner in Bug Hunting.
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 access control for the admin.js file was enforced only on the direct path, and adding an extra directory segment bypassed the check.
What the attacker needed
None
How it was found
- Discovered JavaScript files from the page source and used JSA to extract endpoints.
- Found an endpoint with a 400 status code and combined its name with another directory to form a new directory.
- Enumerated the new directory and found an index.html file.
- Fuzzed for files and found Admin.js with a 401 status code.
- Bypassed the 401 by inserting a directory path before Admin.js, obtaining a 200 response.
- Accessed Admin.js and found admin JWTs and third-party tokens.
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 had a file called admin.js that was supposed to be protected, but by adding an extra folder name in the web address, the protection was bypassed. This file contained secret login tokens for administrators, which could let someone else act as an admin.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.