hardcoded password stored in javascript of https://████.mil
A cleartext password was hardcoded in a JavaScript file used by a staging web application. An attacker could read the password from the client-side code and use it to authenticate to the application.
- Triaged in 3 days
- Fixed in 32 days
- Disclosed after 38 days
Summary:
I have discovered a cleartext password stored within a javascript. This password allows me to authentication to https://█████.mil.
Description:
I have discovered a cleartext password stored within a javascript. This password allows me to authentication to https://███████.mil.
To confirm this vulnerability we will first navigate to https://███████.mil, you are now prompted to type a password. We will provide an incorrect password such as 'Password'.
██████████
███
We can confirm the password is invalid. However, reviewing the javascript data for '██████.chunk.js' we can confirm the authentication is validated based on a hardcoded password '█████████!'.
███████
We can now confirm if we can access the staging web app using hardcoded password.
██████
███████
Impact
By knowing the password, it is possible to understand your password policy and structure which will encourage bruteforcing and password spray attacks in your environment.
Step-by-step Reproduction Instructions
- Navigate to https://█████████.mil.
- Open your browser debugger by pressing F12.
- Click on Network and refresh the page.
- Open the javascript '██████████.chunk.js' and look for where the password is stored. You will see "(n=prompt("Enter Password","Password"),o="██████;" copy the password.
- Now close out your browser debugger and refresh the page and type the password in.
- You now have access to ████████.mil
Suggested Mitigation/Remediation Actions
If this staging web application needs to be password protected, you can refer to the following AWS documentation on how to properly setup basic authentication https://docs.aws.amazon.com/speke/latest/documentation/authentication.html.
Resources: https://owasp.org/www-community/vulnerabilities/Use_of_hard-coded_password
Impact
By knowing the password, it is possible to understand your password policy and structure which will encourage bruteforcing and password spray attacks in your environment.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application used a client-side password check with the password embedded in JavaScript instead of enforcing authentication on the server.
Impact
Anyone who reads the JavaScript can obtain the password and authenticate to the staging application, which could also reveal the password policy and encourage brute-force or password-spray attacks.
What the attacker needed
Access to the staging web app URL; ability to view page source or use browser debugger
The fix
The application should enforce authentication on the server side and should not store passwords in client-side code; the report suggests using proper basic authentication as described in AWS documentation.
How it was found
- Navigate to the staging web application.
- Open the browser debugger and go to the Network tab, then refresh the page.
- Open the JavaScript chunk file and find the hardcoded password.
- Close the debugger, refresh the page, and enter the password to gain 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 report has not been written yet. The Original tab links to the source.
A website's JavaScript code is sent to every visitor's browser, so anything written in it can be read by anyone. Here, the password needed to enter the site was written directly in that code, so anyone who looked at the code could find it and log in.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.