Skip to content
Misconfiguration Disclosed report Beginner

Wordpress Takeover using setup configuration at http://████.edu [HtUS]

An exposed WordPress setup-config.php installation page let anyone finish installing WordPress by pointing it at a MySQL database they controlled, without needing any credentials on the target. The reporter then had admin access to the site and claims this could lead to remote code execution and full system compromise.

ghostkernalbbt Follow

Originally disclosed on HackerOne

Bounty$1,000 Critical View original
  • Triaged in 1 hour
  • Fixed in 30 days
  • Paid in 4 hours
  • Disclosed after 6 months

Description:

The WordPress 'setup-config.php' installation page allows users to install WordPress in local or remote MySQL databases. This typically requires a user to have valid MySQL credentials to complete. However, a malicious user can host their own MySQL database server and can successfully complete the WordPress installation without having valid credentials on the target system.

Reproduce step by step:

I found this vulnerable url: http://███.edu/old/wp-admin/setup-config.php

Then i configured db I used this site https://www.freemysqlhosting.net/

After configure I got wordpress admin access

proof: http://██████████.edu/old/rce.txt

Admin credentials that I set after installing the config username: ████████ password: ███

Login Panel: http://████████.edu/old/wp-login.php

Video POC has been attached as well.

Impact

Impact Remote Code Execution/Total system compromise. Attacker can upload webshell into the server. I did not upload any shell for security violation.

Malware distribution Phishing / Spear phishing XSS Authentication bypass

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

WordPress ships an installation wizard whose first step is setup-config.php. That page collects the database details (host, user, password, table prefix) and, once it can reach a MySQL server with those credentials, writes wp-config.php and lets the installer create the tables and the first administrator account. The whole flow assumes that the person reaching it is the person who owns the server, and that the database it talks to is the one the site owner provisioned.

The vulnerable page sat in an old copy of the site:

Text
http://███.edu/old/wp-admin/setup-config.php

The report is filed as a misconfiguration and rated critical.

Setup

The researcher needed nothing on the target: no account, no credentials, no shell. The only external resource used was a free hosted MySQL service, https://www.freemysqlhosting.net/, which supplied a database the researcher controlled. The precondition is that setup-config.php is reachable.

Finding it

The researcher located the installation page under the /old/ path of the site. A live setup-config.php on a production host is already suspicious: it means an uninstalled WordPress tree is exposed, and the installer will accept database settings from whoever loads the page.

The reasoning in the report is that the page is designed to install WordPress against a local or remote MySQL database, and that this normally requires valid MySQL credentials. The flaw is that nothing ties the database to the target: an attacker can point the installer at a database they host themselves and still complete the installation on the victim's server.

Exploitation

Step 1: Reach the installer

The researcher opened the installation page directly:

Text
http://███.edu/old/wp-admin/setup-config.php

Step 2: Supply an attacker-controlled database

The researcher created a database on https://www.freemysqlhosting.net/ and entered those connection details into the wizard. The researcher entered the connection details of the database they hosted into the wizard. No credentials belonging to the target were needed at any point.

Step 3: Complete the installation and obtain admin access

With the wizard satisfied, the installation finished and the researcher ended up with administrative access to the WordPress instance. The report records the resulting administrator account, with the values redacted here:

Text
username: ████████
password: ███

The login panel is:

Text
http://████████.edu/old/wp-login.php

Step 4: Proof of code execution

The report gives this URL as proof:

Text
http://██████████.edu/old/rce.txt

A video proof of concept was attached to the report as well. The researcher states explicitly that no webshell was uploaded, to avoid violating the program's rules.

Root cause

The installer trusts the database connection details supplied by the visitor and does not verify that the resulting installation belongs to the site owner. Once the wizard writes wp-config.php and creates the first administrator, the attacker is the administrator. The report frames this as a misconfiguration: an uninstalled WordPress tree was left reachable at a public path, so the setup flow that should have run once, on a trusted host, was available to anyone.

Why the existing defences did not help is not described in the report.

Impact

The report lists the following consequences:

  • Remote Code Execution and total system compromise. The researcher notes an attacker can upload a webshell into the server, and that they did not do so.
  • Malware distribution.
  • Phishing and spear phishing.
  • XSS.
  • Authentication bypass.

These apply once the attacker has completed the installation and holds administrator rights on the WordPress instance, which is the condition the report demonstrates.

Fix

The report does not describe a remediation. The measure that follows from the finding is to remove or block access to setup-config.php on any WordPress tree that is not actively being installed, and to delete old, uninstalled copies of WordPress such as the one under /old/ rather than leaving them on the server.

Variants to test

  • Request setup-config.php under common leftover paths (/old/, /backup/, /new/, /test/, /blog/) on any host running WordPress. A positive result is the database configuration form being served to an unauthenticated visitor.
  • Try the same on wp-admin/install.php. A positive result is the installer proceeding to the site setup form.
  • Check whether the wizard accepts a remote database host. A positive result is the installer connecting to a database you control and writing the configuration.
  • Look for wp-config.php files that exist but are empty or incomplete, which indicate an abandoned installation.

Hunting notes

This class of bug hides in forgotten directories: old site copies, staging trees and migration leftovers that were uploaded but never installed. During recon, directory and file discovery for setup-config.php, install.php and wp-config.php under non-standard paths is the main signal, and a 200 with the installation form is enough to start testing.

The report showed impact by completing the installation and obtaining WordPress admin access, while stopping short of uploading a webshell. That combination, an unauthenticated entry point plus demonstrated administrator access and a file on disk, is what carried the critical rating.

A bounty of 1,000.00 USD was awarded, and the report was disclosed on 2023-01-13.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 9 min read.

What happened, in plain words

A website had an old copy of WordPress sitting in a folder called /old/. WordPress is a very popular program for building websites. When you first set it up, it runs a kind of guided form, a "wizard", that asks you for the details of a database so it can store your posts, pages and users.

The researcher who found it opened the wizard directly. They simply opened the wizard, pointed it at a database they had created themselves on a free hosting service, and finished the installation. Because the researcher was the one completing the installation, WordPress made them the administrator, the person with full control of the site.

From there the researcher could have done much worse: run their own code on the server, spread malware, send phishing emails, or bypass logins. They gave a URL on the target as proof and did not upload a webshell, to avoid a security violation. The report was rated critical and paid a bounty of 1,000.00 USD.

The background you need

What WordPress is

WordPress is software that runs on a web server and turns it into a website you can edit through a browser. It stores everything, posts, pages, comments, user accounts, in a database, which is a separate program that holds data in tables, a bit like a very strict spreadsheet. WordPress talks to that database using a language called MySQL (the database program itself is often MySQL or a compatible one).

To connect, WordPress needs four things: the address of the database server (the host), a username, a password, and a table prefix (a short label stuck in front of every table name so several sites can share one database). These are saved in a file called wp-config.php.

What the installation wizard does

The first time you install WordPress, it runs a setup process. The first page of that process is a file called setup-config.php. It shows a form asking for the database details above. When you submit the form, WordPress tries to connect to the database you named. If the connection works, it writes wp-config.php for you, creates all the tables, and asks you to make the first administrator account.

The whole design assumes one thing: that the person filling in the form is the owner of the server, and that the database being named is the one the owner set up. That assumption is exactly what broke here.

What a misconfiguration is

A misconfiguration is not a bug in the code itself. It is a setting or a leftover that was never meant to be exposed. A useful comparison: a house with a perfectly good lock, but the spare key still taped under the doormat. Nothing is broken; something was simply left in the wrong state. Here, an old, never-installed copy of WordPress was left on a public server, so its setup wizard was open to the world.

What remote code execution means

Remote Code Execution, usually shortened to RCE, means an attacker can make the server run commands or programs of their choosing, from a distance, over the internet. It is the most serious kind of web vulnerability because the attacker is no longer limited to what the website's pages allow; they can act like a person sitting at the server's keyboard. A webshell is a small file an attacker uploads that lets them send commands to the server through the browser later. The researcher mentions webshells but says they did not upload one.

The vulnerable page

The researcher found this address on the target:

Text
http://███.edu/old/wp-admin/setup-config.php

Reading it from left to right: http:// is the ordinary, unencrypted way a browser asks for a web page. ███.edu is the domain of the affected organisation. /old/ is a folder on the server, and the name suggests an older copy of the site. /wp-admin/ is WordPress's folder for administrative pages. setup-config.php is the installation wizard's first step.

Why this matters: a live setup-config.php on a public website is reachable by whoever finds it. The wizard is now waiting for the first stranger who finds it.

How the attack worked, step by step

Step 1: Open the wizard

The researcher simply visited the page in a browser:

Text
http://███.edu/old/wp-admin/setup-config.php

The researcher visited the page in a browser. This step was taken first because the whole attack depends on that page being reachable; if it had been removed or protected, there would be nothing to exploit.

Step 2: Bring your own database

Normally the wizard expects the site owner's database details. The researcher instead signed up at a free database hosting service, https://www.freemysqlhosting.net/, and got a database they controlled. They typed those connection details into the form.

Why this works: nothing in the wizard checks that the database belongs to the target. The researcher entered the details of the database they hosted into the form. Think of a hotel receptionist who hands out room keys to anyone who brings their own lock: the key fits, so the receptionist assumes you are a guest.

Step 3: Finish the installation and become the administrator

With the database connection accepted, the installation completed. The installation completed and the researcher set the administrator credentials. The researcher chose the username and password, so the researcher became the site's top-level user. The report records the account, with the values hidden here:

Text
username: ████████
password: ███

Line by line: username: is the login name the researcher set during installation, and password: is the matching password. Both are redacted in the published report. The point is not the specific values; it is that the researcher, not the site owner, decided what they would be.

The login page for that account is:

Text
http://████████.edu/old/wp-login.php

wp-login.php is WordPress's standard sign-in page. Visiting it and entering the account above gives access to the WordPress dashboard, the control panel where an administrator can change the site, install plugins and edit files.

Step 4: Prove code execution

The report gives this URL as proof:

Text
http://██████████.edu/old/rce.txt

A .txt file is plain text. The report presents this URL as proof. The researcher states clearly that they did not upload a webshell, to stay within the programme's rules. A video proof of concept was attached to the report as well.

Why it worked

The installer trusts whatever database details the visitor supplies. It never checks that the database belongs to the site owner, and it never checks that the person filling in the form is authorised to install anything. Once the wizard writes wp-config.php and creates the first administrator, that administrator is the attacker.

The report does not explain why the site's existing protections failed to stop this. What is clear is that an uninstalled copy of WordPress was left reachable at a public path, so a setup process meant to run once, on a trusted machine, was available to anyone.

What the impact could have been

The report lists these consequences:

  • Remote Code Execution and total system compromise. The researcher notes an attacker could upload a webshell, and that they did not.
  • Malware distribution: using the site to hand out harmful files to visitors.
  • Phishing and spear phishing: sending convincing fake messages, possibly from the site's own domain, to trick people into giving up information.
  • XSS, short for Cross-Site Scripting: slipping malicious scripts into pages so they run in other visitors' browsers.
  • Authentication bypass: getting past login checks that should have stopped an outsider.

All of these become possible once the attacker holds administrator rights on the WordPress installation, which is exactly what the report demonstrates.

How to fix it

The report does not describe a fix. The measure that follows from the finding is to remove or block access to setup-config.php on any WordPress copy that is not being installed right now, and to delete old, uninstalled copies of WordPress, such as the one under /old/, instead of leaving them on the server.

Similar things to look for

  • Request setup-config.php under common leftover folder names (/old/, /backup/, /new/, /test/, /blog/) on any site running WordPress. If the database form appears for a visitor who is not logged in, that is a hit.
  • Try the same on wp-admin/install.php. If the installer moves on to the site setup form, that is a hit.
  • Check whether the wizard accepts a database host that is not on the target machine. If it connects to a database you control and writes the configuration, that is a hit.
  • Look for wp-config.php files that exist but are empty or incomplete, which suggest an installation was started and abandoned.

Notes for people hunting this bug

This kind of problem hides in forgotten folders: old copies of a site, staging versions and migration leftovers that were uploaded but never installed. While exploring a target, the main signal is finding setup-config.php, install.php or wp-config.php under unusual paths. A normal 200 response, meaning the page loaded successfully, showing the installation form is enough to start testing.

The report showed impact by completing the installation and obtaining WordPress admin access, while stopping short of uploading a webshell. That combination, an entry point open to anyone plus demonstrated administrator access and a file on disk, is what earned the critical rating.

A bounty of 1,000.00 USD was awarded, and the report was disclosed on 2023-01-13.

Glossary

  • WordPress: a popular program for building and running websites, edited through a browser.
  • Database: a program that stores data in tables, like a strict spreadsheet; WordPress keeps its content and users there.
  • MySQL: the database program (or a compatible one) that WordPress uses to store its data.
  • Host: the address of the machine where a database or website runs.
  • Table prefix: a short label placed in front of every database table name so several sites can share one database.
  • wp-config.php: the WordPress file that holds the database connection details and other core settings.
  • setup-config.php: the first page of the WordPress installation wizard, which asks for database details.
  • Installation wizard: a guided series of forms that sets up software step by step.
  • Administrator: the top-level user of a WordPress site, with full control over its settings, content and files.
  • Dashboard: the control panel an administrator sees after signing in to WordPress.
  • wp-login.php: WordPress's standard sign-in page.
  • Misconfiguration: a setting or leftover that was never meant to be exposed, rather than a flaw in the code itself.
  • Remote Code Execution (RCE): making a server run commands or programs of your choosing from a distance over the internet.
  • Webshell: a small file uploaded to a server that lets an attacker send it commands through a browser.
  • Malware: harmful software, such as a virus or a file designed to damage or spy.
  • Phishing: tricking people into giving up information or clicking harmful links by pretending to be someone trustworthy.
  • Spear phishing: phishing aimed at one specific person or small group, using details about them to seem convincing.
  • XSS (Cross-Site Scripting): slipping malicious scripts into web pages so they run in other visitors' browsers.
  • Authentication bypass: getting past a login or identity check that should have stopped you.
  • Bounty: a reward paid by an organisation to someone who reports a security problem responsibly.
  • Proof of concept (POC): a demonstration, often a video or file, showing that a vulnerability really works.
  • 200 response: the standard web status code meaning the page was found and loaded successfully.
  • Recon: short for reconnaissance, the early stage of exploring a target to find what is 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.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.