Skip to content
Info disclosure Disclosed report Beginner

[insideok.ru] Database Dump

bigbear_ Follow

Originally disclosed on HackerOne

  • Triaged in 4 days
  • Fixed in 7 days
  • Paid in 7 days
  • Disclosed after 15 months
http://insideok.ru/db.sql

Внутри - учётки админов на 2016 год.

-- Хост: localhost
-- Время создания: Сен 03 2016 г., 12:00
-- Версия сервера: 5.5.47-cll-lve
-- Версия PHP: 5.4.45

# Структура таблицы `users`

`CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) unsigned NOT NULL,
  █████
  ███████
  ███████
██████████
███
██████████
███
█████████
███████
████████
█████
█████
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 AVG_ROW_LENGTH=5461;`

# Дамп данны�
 таблицы users

`INSERT INTO `users` (██████████) VALUES
████
███
████████
███
████
███████
████████
███████
█████
███
███
████████
███████
███████
████████
██████
████████
████
███`

The original report as published on HackerOne, by bigbear_. 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 report is a single line pointing at a file on a host called insideok.ru:

Text
http://insideok.ru/db.sql

The researcher states that the file contains administrator accounts dated to 2016. The report then reproduces the head of what appears to be a MySQL dump, including the server banner comments:

Text
-- Хост: localhost
-- Время создания: Сен 03 2016 г., 12:00
-- Версия сервера: 5.5.47-cll-lve
-- Версия PHP: 5.4.45

After the banner, the dump shows the structure of a users table. The column definitions are redacted in the published text, but the surrounding statement is intact:

SQL
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) unsigned NOT NULL,
  █████
  ███████
  ███████
██████████
███
██████████
███
█████████
███████
████████
█████
█████
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 AVG_ROW_LENGTH=5461;

The data section follows the same pattern: the INSERT statement is shown with its column list and values redacted.

SQL
INSERT INTO `users` (██████████) VALUES
████
███
████████
███
████
███████
████████
███████
█████
███
███
████████
███████
███████
████████
██████
████████
████
███

The AUTO_INCREMENT=60 value in the table definition is the only indication of volume in the text. The report does not include the request or response that produced the file, does not name the application behind the host, and does not describe any follow-up action taken with the credentials. It was rated high severity under the weakness category "Improper Authentication - Generic" and disclosed on 25 April 2018. No bounty figure or fix detail appears in the text.

Root cause

The report does not analyse the cause. What it shows is a URL for a database dump on a host, at a guessable filename. The dump also exposes the database host, server build and PHP version in its header comments.

Impact

If the file is what it appears to be, an unauthenticated visitor obtains the users table. The researcher frames the contents as administrator accounts from 2016. Whether those credentials still worked at the time of disclosure is not stated. The schema and version details in the dump help an attacker plan further attacks against the same stack.

How this kind of bug works

Backups, exports and dumps are ordinary files. When they are created inside a directory the web server serves, they inherit the server's behaviour for that directory: static files are returned to anyone unless something explicitly denies access. Nothing in a .sql file is executable, so application-level authentication never runs for it; the request is handled by the web server before any application code is involved. The same applies to .zip, .tar.gz, .bak, .old and editor swap files. Exposure usually comes from routine operations: a developer exports the database to the web root, a deployment script copies a backup into a release directory, or a temporary file is left behind after a migration. Because the filename is often guessable and the file is often linked from nowhere, the bug survives for a long time.

How to test for it

  1. Enumerate common backup names against each host and path you are authorised to test: db.sql, dump.sql, backup.sql, database.sql, db.zip, backup.tar.gz, www.zip, plus date-stamped variants such as backup-2016-09-03.sql.
  2. Check for editor and deployment leftovers: .git/, .svn/, .env, config.php.bak, index.php~, and archive files sitting next to application entry points.
  3. Send a plain GET for each candidate and look at the status code, Content-Type and the first bytes of the body. A positive result is a 200 with SQL comments, CREATE TABLE or INSERT INTO in the body, or a binary archive whose listing contains application source or SQL.
  4. Confirm the file is genuinely served and not a soft 404: compare against a random filename in the same directory and check that the body differs.
  5. Stop at the minimum proof. Record the URL, the response headers and a short excerpt showing the file type, and do not download or retain more personal data than needed to demonstrate the issue.

Common false positives: custom 404 pages that return 200 with HTML, WAF or CDN error pages that echo the requested path, and files that are reachable only because of a caching layer while the origin denies them. Also be careful with archives that turn out to be empty or contain only placeholder content.

How it is fixed

Keep backups outside the document root and serve them from a separate host or storage bucket with authentication. Deny access to backup extensions at the web server level, for example with a location or files rule that returns 403 for *.sql, *.bak, *.old and archive types, and remove stale files from release directories as part of deployment. Disable directory listing so that files cannot be discovered by browsing. Rotate any credentials present in a leaked dump and force a password reset for affected accounts, since the data cannot be un-leaked.

Hunting notes

This class of bug hides wherever humans move files: release directories, upload folders, backup/, old/, tmp/, and the roots of subdomains that host staging or admin tooling. Recon signals include directory listing pages, robots.txt entries pointing at archives, JavaScript or HTML comments referencing export paths, and subdomains whose names suggest internal tooling. Automated content discovery with a backup-oriented wordlist is effective, but manual guessing around known filenames and dates often finds more. To get a report accepted, show the URL, the response proving the file is served, and a redacted excerpt that establishes what kind of data it holds, then stop. Avoid bulk downloading, avoid using any credentials found, and state clearly what you did and did not access.

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. 5 min read.

What happened, in plain words

A file at insideok.ru was reported as a database dump. The researcher found it at a simple, guessable address:

Text
http://insideok.ru/db.sql

A .sql file is a text file that holds the contents of a database, the organised store where a website keeps its users, posts and settings. Think of it as a photocopy of the office filing cabinet. Normally that photocopy sits in a locked room. Here it was left on the pavement outside.

The researcher says the file contained administrator accounts from 2016. The report then shows the beginning of the file, which is a MySQL dump. MySQL is a popular database program, and a dump is its export format: a plain text copy of tables and their rows. The opening lines are comments that the export tool writes automatically:

Text
-- Хост: localhost
-- Время создания: Сен 03 2016 г., 12:00
-- Версия сервера: 5.5.47-cll-lve
-- Версия PHP: 5.4.45

Line by line: -- starts a comment in SQL, the database language. Хост: localhost means the database ran on the same machine as the website. Время создания is the creation time, 3 September 2016. Версия сервера is the database server version, and Версия PHP is the version of PHP, the programming language many websites are built with. These lines record the database host, creation time and software versions.

After the header comes the blueprint of a table called users, the place where accounts are stored:

SQL
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) unsigned NOT NULL,
  █████
  ███████
  ███████
██████████
███
██████████
███
█████████
███████
████████
█████
█████
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 AVG_ROW_LENGTH=5461;

CREATE TABLE means "make a table". id is a unique number for each row. The black blocks are redactions: the person publishing the report hid the column names so that no real data is exposed. AUTO_INCREMENT=60 means the next new row would get the number 60. That is the only hint of size in the text.

The actual data follows in an INSERT statement, the command that adds rows. Its column list and values are redacted in the same way:

SQL
INSERT INTO `users` (██████████) VALUES
████
███
████████
███
████
███████
████████
███████
█████
███
███
████████
███████
███████
████████
██████
████████
████
███

The report does not show the request that fetched the file, does not name the application behind the host, and does not say whether the credentials still worked. It was rated high severity under the category "Improper Authentication - Generic" and disclosed on 25 April 2018. No bounty amount or fix detail appears in the text.

Why does this matter? The report says the file held administrator accounts from 2016.

In general, how this kind of bug works

Websites are folders of files on a server, and a web server hands those files to browsers. When you type an address, your browser sends a request, a short message asking for a page or file, and the server sends back a response with the content. Some files are programs that run and check who you are. A .sql file is not a program. It is a plain document, so the server just hands it over, with no login check at all.

The usual mistake is that someone exported a backup into a folder the web server publishes, and forgot to remove it. The same happens with .zip, .bak, .old and editor leftover files. Because the name is often easy to guess, like db.sql, the file can sit there unnoticed for years.

If you ever test for this on a site you are allowed to test:

  1. Try common backup names on each host and folder: db.sql, dump.sql, backup.sql, database.sql, db.zip, backup.tar.gz, www.zip, and dated versions such as backup-2016-09-03.sql.
  2. Look for leftovers: .git/, .svn/, .env, config.php.bak, index.php~.
  3. Request each one and check the reply. A real hit returns a normal success status with SQL words like CREATE TABLE or INSERT INTO in the body, or an archive containing source code or SQL.
  4. Make sure it is not a fake page: request a random name in the same folder and confirm the reply is different.
  5. Stop at the minimum proof. Note the address, the response headers and a short redacted excerpt, and do not download more personal data than needed.

Watch for false alarms: custom "page not found" pages that still report success, security filters that echo the address back, and files that only appear through a caching layer.

The fix is to keep backups outside the public folders, or on separate storage that requires a login. Block backup file types at the web server so they return a refusal, remove old files during deployment, and turn off folder listings so files cannot be browsed. Finally, change every password that appeared in the leaked file, because once data is public it cannot be made private again.

Glossary

  • Database: an organised store of data, such as user accounts, kept by a website.
  • MySQL: a common database program.
  • Dump: a plain text export of a database's tables and rows.
  • SQL: the language used to talk to a database.
  • Table: a grid of rows and columns inside a database, like a spreadsheet.
  • Row: one record in a table, for example one user account.
  • Column: one field of a record, for example a username.
  • CREATE TABLE: the SQL command that defines a new table.
  • INSERT: the SQL command that adds rows of data.
  • AUTO_INCREMENT: a setting that gives each new row the next number automatically.
  • Redaction: hiding parts of a text, here shown as black blocks, so real data is not published.
  • Request: the message a browser sends to a server asking for a page or file.
  • Response: what the server sends back, including a status code and the content.
  • Status code: a number saying how the request went, such as success or not found.
  • Web server: the program that delivers website files to browsers.
  • Document root: the folder whose files the web server publishes.
  • PHP: a programming language many websites are built with.
  • Header: the opening lines of a dump that record details such as host and versions.
  • Authentication: checking who someone is, usually with a username and password.
  • Credential: a login detail, such as a username and password.
  • Password hash: a scrambled form of a password stored in a database.
  • Account takeover: an attacker gaining control of someone else's account.
  • Severity: a rating of how serious a bug is.
  • Disclosure: the public release of a bug report.
  • Bounty: a reward paid for a valid bug report.
  • False positive: a result that looks like a bug but is not.
  • WAF: a filter that inspects web traffic and blocks suspicious requests.
  • CDN: a network of servers that caches and delivers website content.
  • Caching layer: a store that keeps copies of content to serve it faster.
  • Directory listing: a web page that shows the files in a folder.
  • robots.txt: a file telling search engines which paths not to crawl.
  • Reconnaissance: gathering information about a target before attacking it.
  • Content discovery: automatically trying many file and folder names to find hidden ones.
  • Wordlist: a list of common names used in such guessing.
  • Soft 404: a "not found" page that still reports a success status.

More by bigbear_

View all

3 more disclosed reports, best first.

More from ok.ru

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.