Skip to content
Info disclosure Disclosed report Beginner

Critical sensitive information Disclosure. [HtUS]

A publicly reachable backup file of a PHP script exposed database credentials, including the hostname, database name, username and password. An attacker could use these credentials to attempt to access the database and the system behind it.

ghostkernalbbt Follow

Originally disclosed on HackerOne

Bounty$500 High 7.5 View original
  • Triaged in 6 hours
  • Fixed in 37 days
  • Paid in 6 hours
  • Disclosed after 6 months

(Database user,Database password,Database name) on https://██████.edu/

I got sensitive information: view-source:https://██████████.edu/database.php.orig

Database information (Database user,Database password,Database name) $hostname = '████████.edu'; $db = '█████████'; $username = '████_user'; $password = '████';

Impact

Bug impact: Sensitive information disclosed and possible for an attacker can access into the system.

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

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

The target is a host under the .edu domain, reported through the U.S. Department of Defence program. The researcher reports that a file named database.php.orig could be read directly, exposing database connection settings.

The steps were short:

  1. The researcher located a file named database.php.orig on the site.
  2. They opened the file through the browser's view-source feature, which shows the raw bytes of the resource rather than rendering it:
Text
view-source:https://██████████.edu/database.php.orig
  1. The response contained the database connection settings in plain text: the hostname, the database name, the database user and the database password.

The report quotes the leaked block as follows:

Text
$hostname     = '████████.edu';
$db         = '█████████';
$username     = '████_user';
$password     = '████';

The same values are summarised at the top of the report as the database user, database password and database name, and the target is given as https://██████.edu/.

The report was rated high severity with a CVSS score of 7.5, classified as information disclosure, and paid a bounty of 500.00 USD. It was disclosed on 13 January 2023. The report does not describe a fix.

Root cause

The file name suggests a backup or editor-generated copy of a configuration script, though the report does not say how it got there. The .orig suffix is the kind of name left behind by merge tools and editors, and such files are usually not handled by the PHP interpreter. When a file with a non-PHP extension is requested, the web server treats it as a static resource and returns its contents verbatim, so the PHP source, including the hard-coded credentials, is sent to the client instead of being executed. The report itself does not state the server configuration, only the file name and the leaked content.

Impact

The report says sensitive information was disclosed and that it is possible for an attacker to access the system. The leaked values are a database hostname, name, user and password, so anyone who can reach that database service with them may be able to log in, depending on network exposure and the account's privileges.

How this kind of bug works

Web servers decide how to handle a request from the file extension. A .php file is passed to the PHP interpreter, which runs the code and returns only its output. A file with any other extension, such as .orig, .bak, .txt or .swp, is served as a static file, so its full contents, source code included, go to the client. Configuration scripts are especially dangerous in this situation because they typically contain database credentials, API keys and other secrets in plain text.

These files appear for mundane reasons: version control checkouts, editor swap and backup files, merge conflict copies, deployment scripts that copy a directory wholesale, or administrators renaming a file instead of deleting it. The bug class is a form of sensitive information exposure through misconfiguration, and it is prevented by never placing such files in the document root and by configuring the server to deny access to backup and source extensions.

How to test for it

Testing is mostly about enumeration and careful confirmation:

  1. Map the application's structure. Crawl the site, read JavaScript and HTML comments, and note the names of scripts and directories that are referenced.
  2. Guess common derivative names for each script you find: append or substitute suffixes such as .orig, .bak, .old, .save, .swp, .txt, .zip and ~, and try the file name with a trailing dot or with a different extension.
  3. Request each candidate and inspect the response body and Content-Type. A positive result is a response that contains source code, configuration assignments, credentials or other material that the running application would never render. Compare against the normal request for the same path to see the difference.
  4. Check for directory listing on directories that hold configuration or backup files, and check for exposed version control metadata that would let you reconstruct source files.
  5. If credentials are found, do not attempt to authenticate with them. Report the finding and let the program verify exposure.

Common false positives: a page that merely mentions the word "password" in HTML, a generic error page that echoes a path, or a file that is served but contains only comments or placeholder values. Confirm that the content is genuinely secret and belongs to the target before reporting.

How it is fixed

  • Remove backup, editor and merge artefacts from the web root, and add deployment steps that exclude them.
  • Configure the web server to deny requests for sensitive extensions and dotfiles, and to refuse directory listings.
  • Move credentials out of source files into environment variables or a secrets manager, so that a leaked source file does not automatically leak working credentials.
  • Rotate any credential that was exposed, and review database and network access so that a leaked account has the least privilege possible.

Hunting notes

This bug class hides where deployments are manual or messy: legacy PHP applications, sites with old upload directories, and hosts where administrators edit files in place. Recon signals include directory listing enabled on asset folders, version-control directories reachable over HTTP, and script names that suggest copies of configuration files. When you find a candidate, fetch it with a plain request and confirm the body contains real secrets rather than template text.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What happened, in plain words

A host under the .edu domain, reported through the U.S. Department of Defence program, had a file named database.php.orig that anyone on the internet could read. That file contained a database hostname, database name, username and password.

A database is the place where a website stores its information: user accounts, records, settings. To read and write that information, the website has to log in to the database, and it keeps those login details in a configuration file. A file ending in .php is normally run as code by the web server, so visitors see only its output, not its contents. The problem here is that a file with a different name ending, .orig, was readable. The server did not treat that copy as code, so it simply handed the file's text to anyone who asked for it.

The researcher found the file and viewed it through view-source. The report was rated high severity with a CVSS score of 7.5, classified as information disclosure, and paid a bounty of 500.00 USD. It was disclosed on 13 January 2023.

The steps, one by one

  1. The researcher located a file named database.php.orig on the site. The .orig ending is the kind of name a merge tool or an editor leaves behind when it makes a copy of a file, so it hints at a copy of database.php.
  2. They used the browser's view-source feature. View-source tells the browser to fetch the raw bytes of a page and show them as text rather than drawing the page. View-source shows the raw text of the resource:
Text
view-source:https://██████████.edu/database.php.orig
  1. The server sent back the file's contents in plain text: the hostname, the database name, the database user and the database password.

The report quotes the leaked block like this:

Text
$hostname     = '████████.edu';
$db         = '█████████';
$username     = '████_user';
$password     = '████';

Each line is a setting. $hostname is the address of the database server, $db is the name of the database, and $username and $password are the login details. The report also summarises the same values at the top as the database user, database password and database name, and gives the target as https://██████.edu/.

Why does this matter? Because those four values are what a program uses to connect to the database. Anyone who can reach the database server and knows them can try to log in. The report says sensitive information was disclosed and that it is possible for an attacker to access the system. It does not show anyone actually connecting with the credentials or any data taken from the database, and it does not describe a fix.

In general, how this kind of bug works

When your browser asks a web server for a file, the server decides what to do based on the file's extension, the part after the last dot. A file ending in .php is handed to the PHP interpreter, which runs the code and returns only the result, the way a restaurant kitchen sends out a plated dish and not the recipe. A file with any other ending, such as .orig, .bak, .txt or .swp, is treated as a plain static file, so the server sends its full contents, source code included, the way a shop hands you the recipe book itself.

Configuration scripts are the worst files to expose this way, because they usually hold database credentials, API keys and other secrets written out in plain text. These leftover files appear for ordinary reasons: editors save backup and swap copies, merge tools write .orig files when a conflict is resolved, deployment scripts copy whole folders without filtering, or an administrator renames a file instead of deleting it. The bug class is sensitive information exposure through misconfiguration, and the cure is to keep such files out of the folder the web server publishes, and to configure the server to refuse requests for backup and source extensions.

In general, how to test for it

Testing is mostly about looking carefully and confirming what you see:

  1. Map the site. Browse it, read the page source and the JavaScript, and note the names of scripts and folders that are mentioned.
  2. For each script name you find, try common derivative names: add or swap endings such as .orig, .bak, .old, .save, .swp, .txt, .zip and ~, and try the name with a trailing dot or a different extension.
  3. Request each candidate and look at the response body and its Content-Type header, which tells the browser what kind of file it is receiving. A hit is a response containing source code, configuration assignments or credentials, material the running site would never show a visitor. Compare it with the normal request for the same path to see the difference.
  4. Check whether folders holding configuration or backup files allow directory listing, where the server shows a list of every file inside, and whether version control metadata is reachable, since that can let someone rebuild source files.
  5. If you find credentials, do not log in with them. Report the finding and let the program verify the exposure.

Watch for false positives: a page that merely contains the word "password", a generic error page that repeats a file path, or a file that is served but holds only comments or placeholder values. Confirm the content is genuinely secret and belongs to the target before reporting.

In general, how it is fixed

  • Remove backup, editor and merge leftovers from the published folder, and add deployment steps that exclude them.
  • Configure the web server to deny requests for sensitive extensions and hidden dotfiles, and to refuse directory listings.
  • Move credentials out of source files into environment variables or a secrets manager, so a leaked source file does not automatically leak working credentials.
  • Rotate any credential that was exposed, and review database and network access so a leaked account has as few privileges as possible.

Glossary

  • Database: an organised store of information that a website reads and writes, such as user accounts and records.
  • Credentials: the username and password (or similar pair) used to log in to a system.
  • Configuration file: a file holding a program's settings, often including credentials, rather than the program's logic.
  • PHP: a programming language commonly used to build websites; the server runs PHP files and returns their output.
  • Web server: the program that receives browser requests and sends back files or generated pages.
  • Request: the message a browser sends to a server asking for a page or file.
  • Response: the message the server sends back, containing the content and headers.
  • Header: extra information attached to a request or response, such as Content-Type.
  • Content-Type: the header that says what kind of content is being sent, for example a web page or a plain text file.
  • Static file: a file the server sends as-is, without running it through an interpreter.
  • Source code: the human-written text of a program, before the server runs it.
  • Extension: the part of a file name after the last dot, such as .php or .orig, which the server uses to decide how to handle the file.
  • .orig file: a copy left behind by a merge tool or editor, usually not run as code.
  • view-source: a browser feature that fetches a page and shows its raw text instead of rendering it.
  • Hostname: the address of a server, such as the name of the database machine.
  • Information disclosure: a bug where information that should stay private is exposed to someone who should not see it.
  • CVSS: a standard scoring system for rating the severity of a security bug.
  • Bounty: a payment a program makes to a researcher who reports a valid bug.
  • Directory listing: a server feature that shows a list of all files in a folder instead of a page.
  • Version control metadata: hidden files a code management tool keeps, which can reveal source code.
  • Least privilege: giving an account only the access it truly needs, so a leak does less damage.
  • Rotate: replace a credential with a new one after it has been exposed.

More by ghostkernalbbt

View all

1 more disclosed report, 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.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.