config files with vpn pre-shared-key and other credentials in them
A directory with indexing enabled on an nginx server exposed a zip file containing credentials such as RADIUS passwords, network equipment administrator passwords, Wi-Fi passwords, an IKE pre-shared key for corporate VPN access, and financial information. An attacker who found the directory could download the archive and obtain these secrets.
- Accepted in 2 days
- Fixed in 3 days
- Disclosed after 2.0 years
Summary by xail
I was able to enumerate a directory with directory indexing enabled running on an nginx server.
This was the location: https://trt.teslamotors.com/uploads/itscripts/pdx01.zip
Within this directory I encountered a zip file containing sensitive information such as: Radius passwords Administrator passwords for the network equipment wifi passwords for Tesla stores IKE pre-shared-key password for Tesla corporate/internal VPN access Tesla real estate financial information
What the report shows
This is a Bugcrowd report against Tesla, credited to the researcher xail, rated critical and paid a bounty of 10,000 USD. It was disclosed on 26 February 2021 and concerns the asset *.teslamotors.com.
The researcher found a directory with directory indexing enabled, served by nginx. The location given in the report is:
https://trt.teslamotors.com/uploads/itscripts/pdx01.zip
Inside that directory the researcher encountered a zip file containing sensitive information. The report lists what it held:
- Radius passwords
- Administrator passwords for the network equipment
- Wi-Fi passwords for Tesla stores
- IKE pre-shared-key password for Tesla corporate/internal VPN access
- Tesla real estate financial information
Root cause
The report points to directory indexing being left enabled on an nginx server, so that a request to a directory path returns a generated listing of its files instead of a denial or a redirect. The report says the directory had indexing enabled and that the researcher encountered a zip file there containing sensitive information.
Impact
The report's own framing is that the archive contained sensitive information: Radius passwords, administrator passwords for network equipment, Wi-Fi passwords for Tesla stores, the IKE pre-shared key for corporate/internal VPN access, and real estate financial information. The report describes the archive as containing sensitive information, including credentials and financial data. The report does not demonstrate any use of the credentials, so the realised impact beyond exposure is not shown.
How this kind of bug works
Web servers can be configured to generate an HTML index for a directory when no default document is present. When that behaviour is on, any directory that is reachable and not protected by authentication returns a browsable list of file names, and each name links to the file. The feature is convenient during development and easy to leave on in production, particularly on hosts that serve static content, uploads, build artefacts or internal tooling.
The risk is not the listing itself but what sits behind it. Directories used for uploads, backups, exports and script bundles often contain archives, configuration files, database dumps and logs. A listing turns an unguessable file name into a discoverable one, and a reachable archive into a downloadable one. The defences are to disable automatic indexing, to keep operational material off web-facing hosts, and to require authentication in front of anything that must stay there.
How to test for it
- Map directories rather than only pages. Content discovery against a host will surface paths such as uploads, backups, scripts, assets and exports; also watch for paths leaked in JavaScript, error pages, robots files and public code repositories.
- Request a discovered directory path without a trailing file name and observe the response. A positive result is a generated listing: an HTML page enumerating files with links, often with a title naming the directory and a server header identifying the software.
- Compare behaviour across hosts in scope. The same application may have indexing on in one environment and off in another.
- When a listing appears, note the file types. Archives, configuration files, key material, database dumps and logs are the interesting ones; static images and stylesheets are not.
- Confirm reachability of a single file from the listing with a direct request, and stop there. Do not use any credential found; report the exposure.
Common false positives: a custom error page or a single-page application route that returns 200 for any path and looks like a listing; a directory that lists files but where every file returns 403 or a login redirect; and listings that contain only public static assets with no sensitive material. A listing of build output with no secrets is usually not worth reporting on its own.
How it is fixed
The standard fix is to turn off automatic directory indexing in the web server configuration, so a request for a directory without a default document returns a denial or a redirect rather than a listing. Beyond that, remove the sensitive material from the web root: archives containing credentials, configuration files and financial data should not be stored on a host that serves the public internet. Where such files must exist, put authentication and authorisation in front of them, restrict access by network location, and rotate any credential that was exposed for as long as the file was reachable.
Hunting notes
Directory indexing tends to hide on hosts that are not the main application: legacy subdomains, staging and QA environments, static asset hosts, upload endpoints, and paths used by internal scripts or scheduled jobs. Names such as uploads, backup, backups, export, scripts, tmp and assets are worth trying, and so are paths harvested from JavaScript bundles and from error messages.
Recon signals that point at it include a server header for a web server known for optional auto-indexing, directory paths that return a listing-shaped page, and archives or configuration file extensions appearing in content discovery results. Once a listing is found, the strongest report shows the listing, the reachability of one sensitive file, and a clear statement of what kind of material it contains, without using it. Programs accept these reports when the exposure is concrete and the data is genuinely sensitive; a listing of public assets rarely qualifies.
What happened, in plain words
This is a Bugcrowd report against Tesla, credited to the researcher xail. It was rated critical, paid a bounty of 10,000 USD, and was disclosed on 26 February 2021. The asset in scope was *.teslamotors.com, meaning any subdomain of teslamotors.com.
A website is normally a set of pages you visit. Behind those pages, the server also has folders, just like the folders on your own computer. When you ask for a folder rather than a specific page, a web server can do one of two things: refuse, or show you a list of everything inside. That second behaviour is called directory indexing, and it is a setting that someone has to leave switched on.
The researcher found a folder on an nginx server (nginx is a common web server program) where that listing was switched on. The location given in the report is:
https://trt.teslamotors.com/uploads/itscripts/pdx01.zip
Reading that address from left to right: https:// is the secure web protocol, trt.teslamotors.com is the particular Tesla subdomain, and the rest is the path to a file called pdx01.zip inside folders called uploads, itscripts. A .zip file is a compressed archive, a single file that holds many other files inside it, like a box packed with documents.
The report says the zip file contained sensitive information. The report lists five kinds of material:
- Radius passwords
- Administrator passwords for the network equipment
- Wi-Fi passwords for Tesla stores
- IKE pre-shared-key password for Tesla corporate/internal VPN access
- Tesla real estate financial information
Each of these matters for a different reason. Radius is a system for controlling who may connect to a network, so its passwords guard network access. Administrator passwords for network equipment are the keys to the routers and switches themselves. Wi-Fi passwords let someone join the wireless network inside Tesla stores. An IKE pre-shared key is the secret that two ends of a VPN tunnel use to recognise each other; a VPN is a private, encrypted channel over the public internet, so this key is effectively a password to the corporate network. The financial information about real estate is simply private business data.
In general, how this kind of bug works
Web servers can be configured to build a web page listing a folder's contents when there is no default page to show. With that behaviour on, anyone who reaches the folder sees a clickable list of file names, and each name links straight to the file. It is handy while building a site and easy to forget to switch off, especially on servers that hold uploads, backups or internal scripts.
The listing itself is not the real problem. The problem is what sits behind it. Folders used for uploads, backups and script bundles often contain archives, configuration files and database dumps. A listing turns a file name nobody could guess into one anybody can click, and a reachable archive into a downloadable one. The defences are to switch automatic indexing off, to keep operational material off internet-facing servers, and to put a login in front of anything that must stay there.
How to test for it
- Look for folders, not just pages. Try common names such as
uploads,backup,scriptsandassets, and watch for paths mentioned in page code, error messages and robots files. This matters because the interesting material usually lives in folders nobody links to. - Request a folder path without a file name at the end and look at the response. A generated list of files with links is the positive sign, often with a title naming the folder.
- Compare hosts in scope. The same application may have indexing on in one environment and off in another.
- When a listing appears, note the file types. Archives, configuration files, key material and logs are the interesting ones; images and stylesheets are not.
- Confirm that one file from the listing can actually be fetched with a direct request, then stop. Do not use any credential you find; report the exposure.
Common false positives: a custom error page or a single-page application that answers 200 to any path and merely looks like a listing; a folder that lists files but where every file returns 403 or a login redirect; and listings that contain only public static assets. A listing of build output with no secrets is usually not worth reporting on its own.
How it is fixed
The standard fix is to turn off automatic directory indexing in the web server configuration, so a request for a folder without a default page returns a denial or a redirect instead of a list. Beyond that, remove the sensitive material from the web root: archives containing credentials, configuration files and financial data should not sit on a host that serves the public internet. Where such files must exist, put authentication and authorisation in front of them, restrict access by network location, and rotate any credential that was exposed for as long as the file was reachable.
Hunting notes
Directory indexing tends to hide on hosts that are not the main application: legacy subdomains, staging and QA environments, static asset hosts, upload endpoints, and paths used by internal scripts or scheduled jobs. Names such as uploads, backup, backups, export, scripts, tmp and assets are worth trying, and so are paths harvested from JavaScript bundles and error messages.
Signals that point at it include a server header for a web server known for optional auto-indexing, folder paths that return a listing-shaped page, and archive or configuration file extensions appearing in content discovery results. Once a listing is found, the strongest report shows the listing, the reachability of one sensitive file, and a clear statement of what kind of material it contains, without using it. Programs accept these reports when the exposure is concrete and the data is genuinely sensitive; a listing of public assets rarely qualifies.
Glossary
- Bug bounty: a programme where an organisation pays researchers who report security problems to it.
- Bounty: the money paid for an accepted report.
- Severity: a rating of how serious a bug is, here critical, the highest level.
- CVSS: a standard scoring system for the severity of a vulnerability.
- Asset: the specific system or domain a programme allows testing on, here
*.teslamotors.com. - Subdomain: a named part of a larger domain, such as
trt.teslamotors.comunderteslamotors.com. - Web server: the program that answers browser requests and sends back pages and files.
- nginx: a widely used web server program.
- Directory: a folder on a server that holds files.
- Directory indexing: a web server setting that shows a clickable list of a folder's files when no default page exists.
- Request: the message a browser sends to a server asking for a page or file.
- Response: what the server sends back, such as a page, a file or an error.
- HTTP status code: a number in the response saying what happened, such as 200 for success or 403 for forbidden.
- Redirect: a response that sends the browser to a different address.
- Authentication: proving who you are, usually with a username and password.
- Authorisation: deciding what an authenticated person is allowed to do.
- Web root: the folder on a server whose contents are served to the public.
- Archive: a single file holding many files inside it, such as a zip file.
- Configuration file: a file holding settings and often credentials for a program or system.
- Credential: any secret used to prove identity, such as a password or key.
- Radius: a system that controls who may connect to a network.
- VPN: a private, encrypted channel over the public internet.
- IKE pre-shared key: the shared secret two ends of a VPN tunnel use to recognise each other.
- Rotate: replace a secret with a new one, so the old one stops working.
- False positive: a finding that looks like a problem but is not one.
- Content discovery: systematically trying common paths and file names to find what a site exposes.
- Recon: short for reconnaissance, the information-gathering stage before testing.