Skip to content
Leaked secrets Disclosed report Beginner

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.

x3ph_ Follow

Originally disclosed on HackerOne

  • 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

  1. Navigate to https://█████████.mil.
  2. Open your browser debugger by pressing F12.
  3. Click on Network and refresh the page.
  4. 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.
  5. Now close out your browser debugger and refresh the page and type the password in.
  6. 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.

The original report as published on HackerOne, by x3ph_. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Navigate to the staging web application.
  2. Open the browser debugger and go to the Network tab, then refresh the page.
  3. Open the JavaScript chunk file and find the hardcoded password.
  4. 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.

More by x3ph_

View all

5 more disclosed reports, best first.

More from U.S. Dept Of Defense

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.