MariaDB #mysql50# Table-Name Encoding Bypass and Table-Cache Alias (CVE-2026-92262)
Published: 2026-11-25 • Researcher: SeanDishman (PoC); MariaDB Security Team (MDEV-40362 / GHSA-65jj-h265-3m7h)
- Severity
- Critical
- CVE
- CVE-2026-92262
- Category
- network
- Affected product
- MariaDB Server (table-name filesystem encoding and table-cache / share keying)
- Affected versions
- 10.6.1–10.6.27, 10.11.1–10.11.18, 11.4.1–11.4.12, 11.8.1–11.8.8, 12.3.1–12.3.2 (NVD ranges); also 13.0.1 per the upstream PoC README. Fixed in 10.6.28, 10.11.19, 11.4.13, 11.8.9, 12.3.3 and 13.0.2. Lab target: mariadb:13.0.1-rc (13.0.1-MariaDB-ubu2604).
- Disclosed
- 2026-11-25
- Patch status
- Patched
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-92262
- https://github.com/MariaDB/server/security/advisories/GHSA-65jj-h265-3m7h
- https://jira.mariadb.org/browse/MDEV-40362
- https://github.com/MariaDB/server/commit/574ba66b2d6c5d71db83d416677876e9b592858e
- https://github.com/MariaDB/server/commit/f277eefa424850a8cba5c2371406047f6395e8bb
- https://github.com/MariaDB/server/releases/tag/mariadb-10.6.28
- https://github.com/SeanDishman/mariadb-cve-2026-92262
- https://hackerone.com/reports/3856148
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-25 |
| Last Updated | 2026-10-18 |
| Author / Researcher | SeanDishman (PoC); MariaDB Security Team (MDEV-40362 / GHSA-65jj-h265-3m7h) |
| CVE / Advisory | CVE-2026-92262 |
| Category | network |
| Severity | Critical |
| CVSS Score | 9.9 (CVSSv3.1, NVD; vector not provided in the source data) |
| Status | PoC |
| Tags | mariadb, database, sql, #mysql50#, encoding-bypass, table-cache-alias, cwe-706, low-privilege, data-corruption, file-write |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | MariaDB Server (table-name filesystem encoding and table-cache / share keying) |
| Versions Affected | 10.6.1–10.6.27, 10.11.1–10.11.18, 11.4.1–11.4.12, 11.8.1–11.8.8, 12.3.1–12.3.2 (NVD ranges); also 13.0.1 per the upstream PoC README. Fixed in 10.6.28, 10.11.19, 11.4.13, 11.8.9, 12.3.3 and 13.0.2. Lab target: mariadb:13.0.1-rc (13.0.1-MariaDB-ubu2604). |
| Language / Platform | C/C++ MariaDB server; Python 3 PoC client (pymysql); Linux x86_64 (Docker) |
| Authentication Required | Yes — a valid low-privilege database account with CREATE on one database (no FILE, SUPER or plugin load needed) |
| Network Access Required | Yes — standard MySQL protocol on TCP 3306 |
Summary
MariaDB encodes table names when it maps them to on-disk files, but the historical #mysql50# namespace prefix skips that encoding and does not yield a distinct table-cache key. A table created as #mysql50#t therefore shares one cached share and handler with a table created as t, so rows inserted through one name are visible through the other even when the two definitions declare different column widths. A low-privilege account that can create tables can thus alias another table, corrupt or exfiltrate its rows, and crash the server; it can also write files with unencoded, attacker-chosen names such as a-b.frm inside the data directory instead of the encoded a@002db.frm. NVD rates the issue 9.9 Critical (CWE-706) and states that a crafted table name can cause crashes, data corruption, data exfiltration or remote code execution.
Vulnerability Details
Root Cause
MariaDB stores each table in a file whose name is derived from the table name; characters that are unsafe or ambiguous in a filename are encoded, so a table called a-b becomes a@002db.frm. The legacy #mysql50# prefix, kept for compatibility with MySQL 5.0 table names, bypasses that encoding entirely. Two defects follow from the same prefix: the encoding step is skipped, so attacker-controlled characters reach the data directory verbatim, and the prefix is not part of the effective table-cache / share identity, so #mysql50#t and t collide on one cached table share while carrying different column definitions. The upstream advisory is GHSA-65jj-h265-3m7h / MDEV-40362; the fix landed in the MariaDB server repository (commits 574ba66b2d6c5d71db83d416677876e9b592858e and f277eefa424850a8cba5c2371406047f6395e8bb, see references).
Attack Vector
An authenticated low-privilege user sends ordinary SQL over the normal server port. The PoC creates a base table t, then creates #mysql50#t with a deliberately different column width, inserts a row only through the prefixed name, and reads it back through t. It then creates #mysql50#a-b as MyISAM to show that the on-disk files are written unencoded. No FILE, SUPER, plugin load or administrative privilege is required; CREATE on the current database is enough.
Impact
The alias makes two independently defined tables share one storage object, so rows can be read or overwritten across table boundaries with a mismatched row layout: the archived output shows a BINARY(10) column re-read as BINARY(1), truncating the original value and padding the injected one. That gives cross-table data disclosure and integrity loss, and in the upstream NVD description can extend to crashes, data corruption, data exfiltration and remote code execution. The unencoded filename primitive additionally lets an attacker choose filenames created under the data directory (path traversal with ../ is rejected with ERROR 1103 Incorrect table name, so this is not a general arbitrary-path write).
Environment / Lab Setup
OS: Linux x86_64 with Docker and Docker Compose
Target: mariadb:13.0.1-rc (container name mariadb-vuln, port 3306,
database appdb, user lowpriv / lowpriv, ALL on appdb only,
started with --core-file)
Attacker: Python 3.9+ with pymysql, or the mariadb CLI
Tools: docker compose, pymysql, mariadb clientSetup Steps
| |
The upstream tree keeps the compose file under server/; start.sh resolves its own directory, so it works unchanged from this flat entry folder.
Proof of Concept
Step-by-Step Reproduction
Start the lab —
bash start.shpulls 13.0.1-rc, creates appdb and the lowpriv account and waits for mariadbd to accept connections.Create the base table and a conflicting prefixed alias — run the 92262 payload through the client (or pipe
cve-2026-92262.sqlinto the mariadb CLI):SQL1 2 3 4 5CREATE TABLE t (id INT, c1 BINARY(10)) ENGINE=MEMORY; INSERT INTO t VALUES (1, REPEAT(0x41, 10)); CREATE TABLE `#mysql50#t` (id INT, c1 BINARY(1)) ENGINE=MEMORY; INSERT INTO `#mysql50#t` VALUES (2, 0x42); SELECT id, HEX(c1) FROM t ORDER BY id;Observe the alias — row 2, inserted only through #mysql50#t, is returned by a SELECT on t, and its one-byte value is padded to the ten-byte column. The client prints
PROOF 92262: INSERT into #mysql50#t is visible via SELECT on t.Observe the encoding bypass on disk — create a MyISAM table with an unencoded name and list the data directory:
SQL1CREATE TABLE `#mysql50#a-b` (id INT) ENGINE=MyISAM;Shell script1docker exec mariadb-vuln ls -l /var/lib/mysql/appdb | grep 'a-b'
Exploit Code
See
exploit.py(functionrun_92262) and the equivalent CLI payloadcve-2026-92262.sqlin this folder.
| |
Expected Output
| |
| |
Detection & Indicators of Compromise
- Statements containing the literal
#mysql50#prefix in table names, especially CREATE TABLE or INSERT issued by non-administrative accounts or from unexpected hosts (general log, audit plugin, proxy logs). - Data-directory entries whose names are not in MariaDB’s encoded form (for example a-b.frm without a matching a@002db.frm), or new unexpected files under the database directory.
- Tables visible in information_schema whose names contain
#mysql50#. - Rows appearing in a table that no application path writes to, or column values truncated or zero-padded in a way the schema does not explain.
- MariaDB error 1103 Incorrect table name for names containing
../, which indicates probing of the filename primitive. - Server crashes or aborted connections immediately after DDL with unusual table names.
| |
SIEM / IDS Rule (example):
| |
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade to MariaDB 10.6.28, 10.11.19, 11.4.13, 11.8.9, 12.3.3 or 13.0.2 (or later) and restart mariadbd. Fixed versions per the NVD description and the upstream release tags in references. |
| Workaround | Until patched, revoke CREATE (and where possible DROP/ALTER) from untrusted accounts, and audit existing tables for #mysql50# names. No documented server setting that disables the prefix was found in the reviewed sources. |
| Config Hardening | Enforce least privilege per application database, enable the audit plugin or general log for DDL, restrict 3306 to application hosts, and monitor the data directory for unencoded filenames and unexpected tables. Keep secure_file_priv and filesystem permissions tight because the bug writes into the data directory. |
References
- CVE-2026-92262 — NVD
- MariaDB advisory GHSA-65jj-h265-3m7h
- MDEV-40362 — #mysql50# encoding bypass
- MariaDB server commit 574ba66b2d6c5d71db83d416677876e9b592858e
- MariaDB server commit f277eefa424850a8cba5c2371406047f6395e8bb
- MariaDB 10.6.28 release, 10.11.19, 11.4.13, 11.8.9
- Source PoC repository — SeanDishman/mariadb-cve-2026-92262
- HackerOne report 3856148 — disclosed MariaDB chain referenced by the PoC README
Notes
Auto-ingested from https://github.com/SeanDishman/mariadb-cve-2026-92262 on 2026-11-25. Review verdict: real PoC, not a detector or scanner. exploit.py connects as the low-privilege account and executes the vulnerable SQL directly, and the archived output (row id=2 visible through t, unencoded a-b.frm on disk) is the proof. Status is PoC rather than Weaponized because the archived tree demonstrates the table-cache alias, cross-table corruption/read and unencoded filename creation only; the RCE chain described in the NVD text is not implemented here. The upstream README states that the disclosed HackerOne chain (CVE-2026-85748 plus an ST_Area heap over-read leading to a COOP execlp) is deliberately not in the tree.
The repository bundles PoCs for three CVEs (92262, 85746, 85748). Only the CVE-2026-92262 SQL payload and the shared Python client were archived; the sibling SQL files for 85746 and 85748 were not copied, although exploit.py still contains their functions and upstream-README.md documents all three.
License: the repository has no LICENSE file; files are archived with attribution for authorized research only. The compose lab uses dummy credentials (root/root, lowpriv/lowpriv) on a disposable container and binds 3306 on the host, so do not expose it beyond an isolated test network. Category network (rather than the worklist misc hint) reflects a remotely reachable database service exploited over its normal SQL protocol; the related archive entry pocs/binary/2026-08-09_mariadb-low-priv-rce-st-area-cursor-uaf covers a different MariaDB memory-safety bug.
No exploit code was executed during ingestion; all statements above come from reading the source and the upstream README. Run only against systems you own or have written authorization to test.
| |