Skip to content

HackerOne

MariaDB

Every publicly disclosed report for MariaDB and what kind of bugs they were.

disclosed reports
61
most reported class
Memory corruption
bug classes found
11
first disclosure
2018
Scope, rewards and live status on bugbounty.fyi Paused Disclosure program, no bounty 5 targets in scope

Disclosed reports

Newest first. Only what MariaDB chose to make public.

Info disclosure

Spatial functions perform 4-byte heap buffer over-reads on truncated WKB inputs

Several MariaDB geometry functions read four bytes from a heap buffer without checking that the buffer contains four bytes, so a short crafted WKB hex literal in a SELECT returns adjacent heap memory as an integer. An authenticated user can therefore disclose up to four bytes of heap memory per query, and on ASAN builds the same query crashes the server.

MariaDB

Medium
SQL injection

MariaDB CLI Utility Issues

Several MariaDB command-line utilities build SQL queries from database-supplied names without escaping them, so a malicious database can make the client run injected SQL. The dump tool also has an infinite loop and buffer overflows that can crash the client.

MariaDB

Memory corruption

Connector/C Out-of-bounds read from unterminated GSSAPI SPN in `parse_server_packet()`

The GSSAPI client authentication plugin copies a server-supplied service principal name into a fixed 256-byte stack buffer with strncpy, which does not NUL-terminate when the source fills the buffer, so a later strlen reads past the buffer. A second flaw reads one byte past the packet when the packet contains no NUL byte, and a malicious server could trigger a stack out-of-bounds read or crash the client.

MariaDB

Memory corruption

Connector/ODBC: MADB_Stmt::ArrayOffset is not reset when an exception unwinds out of MADB_StmtExecute, so the next paramset reads out of bounds

A failed parameter-array execute in the MariaDB ODBC connector leaves an internal array offset stale because an exception skips the only reset point, so the next batch on the same handle reads past the application's parameter arrays. This causes either a crash or silently dropped rows in a batch the application believes succeeded.

MariaDB

Medium
Memory corruption

Connector/ODBC: SqlwcsOctetLen sizes UTF-16 with a byte-oriented helper, reading past the caller's buffer and sending client memory to the server

The ODBC driver's SqlwcsOctetLen function sizes UTF-16 strings using a byte-oriented helper that misinterprets characters whose low byte is 0xD8-0xDB as surrogate leads, causing an out-of-bounds read past the caller's buffer. The inflated length is passed to iconv, so adjacent client memory is converted and sent to the database server as part of the SQL statement.

MariaDB

Medium
Race condition

r2dbc-mariadb: server message accepted with no command in flight desynchronises the connection and serves one user's rows to another

The r2dbc-mariadb driver accepts a server packet that arrives when no command is outstanding, buffers it, and delivers it to the next unrelated statement because responses are never correlated with requests and the sequence id is not validated. An attacker able to inject bytes into the TCP stream can permanently desynchronise a pooled connection so that one application user receives another user's rows and a write matching no rows is reported as having matched one.

MariaDB

Medium
SQL injection

Connector/ODBC injects unquoted column names into positioned DELETE and UPDATE via MADB_DynStrGetWhere

The MariaDB Connector/ODBC driver builds positioned DELETE and UPDATE statements by appending the column name from result-set metadata without any quoting, while the value is properly escaped. An attacker who controls a column or table name can inject SQL that runs on the application's connection, for example turning a single-row delete into a delete of every row.

MariaDB

Medium
Memory corruption

Connector/ODBC SQLGetDescRec treats descriptor handle as statement handle, heap OOB write on every call

Two functions in MariaDB Connector/ODBC clear the error record using the statement-handle macro on a descriptor handle, so the driver writes past the end of a smaller descriptor object on every call. With a malicious or man-in-the-middle server, bytes from the server version string are used as the offset for a second write, giving a remotely influenced zero-byte write and a crash.

MariaDB

Medium
Memory corruption

Stack buffer overflow in 9 of 10 Connector/ODBC catalog functions via unbounded name

Nine of the ten ODBC catalog functions in MariaDB Connector/ODBC copy an application-supplied identifier into a fixed 513-byte stack buffer without checking its length, so a name longer than 256 bytes overflows it with attacker-controlled bytes. An attacker who can get a calling application to pass a long identifier into a catalog lookup can crash the process, and on builds without a stack canary can overwrite the saved return address.

MariaDB

Medium
SQL injection

Connector/C++ ignores allowMultiQueries and injects savepoint names into SQL

The MariaDB Connector/C++ driver hardcodes the multi-statement client flag when connecting, so stacked statements are accepted even when allowMultiQueries is false. Separately, savepoint names are concatenated into SQL without quoting, letting a crafted name run arbitrary statements.

MariaDB

Medium
DoS

Connector/C++ aborts client process on server session-tracking packet via std::stoi

The Connector/C++ driver reads the session-tracking system-variable name from an OK packet, compares it to a literal, then calls std::stoi on that same name string, which always throws std::invalid_argument. Because that exception type is not caught by the driver or by applications catching sql::SQLException, a malicious or MITM-positioned server can abort the client process with two packets.

MariaDB

Medium
SQL injection

Connector/C++ string escaper re-escapes its own output, enabling SQL injection

The Connector/C++ string escaper's internal replace helper re-scans its own inserted output, so backslash doubling produces an odd run of escape characters that swallows the closing quote of a SQL literal. An attacker who controls a table, schema or column name passed to a DatabaseMetaData method could break out of the literal and inject SQL, reading rows and schemas the caller did not request.

MariaDB

Medium
Memory corruption

Connector/ODBC: malicious server's long version string wraps size_t PrefixLen via negative _snprintf return, causing heap out-of-bounds write

The ODBC driver builds an error-message prefix from the server-supplied version string using a custom snprintf that returns a negative value on truncation; adding that negative to an unsigned size_t length wraps it to a huge value. A malicious or man-in-the-middle server sending a very long version string therefore causes an out-of-bounds heap write in the client when a statement is allocated, demonstrated as a crash.

MariaDB

Medium
Memory corruption

Connector/C++: heap out-of-bounds read when malicious server field length exceeds declared column length in binary result path

MariaDB Connector/C++ allocates result-column buffers using the column length declared at PREPARE time, but then trusts the per-row field length reported by the server without clamping it to the buffer size. A malicious or man-in-the-middle server that declares a small column but sends a larger field value causes a heap out-of-bounds read, leaking adjacent process memory into application-visible column values and crashing the client.

MariaDB

Medium
DoS

r2dbc-mariadb Parsec auth: server-controlled PBKDF2 iteration count causes CPU-exhaustion DoS ( regression from b7766de )

The Parsec authentication plugin in the r2dbc-mariadb driver took a PBKDF2 iteration exponent directly from the server's handshake reply and only capped it at 20, so a malicious or man-in-the-middle server could force roughly a billion hashing rounds per connection. This pinned a client CPU core for around 25 minutes per attempt, and with a retrying connection pool it could exhaust the whole application's CPU.

MariaDB

Medium
DoS

MariaDB HandlerSocket Improper Request Field-Count Validation Causes Server Crash

HandlerSocket, an optional MariaDB plugin, allocates stack memory based on a client-supplied field count before validating that the count is within the index's allowed field limit. An attacker who can reach the HandlerSocket port can send an abnormally large field count and crash the mariadbd process, making the database unavailable.

MariaDB

Medium
DoS

Pre-authentication `size_t` integer underflow → out-of-bounds read / server crash in MariaDB `caching_sha2_password` (auth_mysql_sha2) via an RSA-OAEP

The caching_sha2_password server plugin decrypts the client's RSA password reply and subtracts one from the resulting length without checking for an empty plaintext, so a zero-length message underflows a size_t to SIZE_MAX. An unauthenticated attacker can send an RSA-OAEP encryption of an empty message to trigger an out-of-bounds read and crash the whole server.

MariaDB

Medium
Path traversal

DATA / INDEX DIRECTORY Abuse

A user with only schema-level privileges could abuse the DATA DIRECTORY and INDEX DIRECTORY table options to write files outside the intended data directory, including into restricted locations, by exploiting path traversal and filename length issues. This could allow writing almost arbitrary content to attacker-chosen files, potentially leading to code execution or data leakage.

MariaDB

SQL injection

`SHOW [CREATE|GRANTS] ...` / `mariadb-dump` Unescaped SQL Generation

Several SHOW CREATE and SHOW GRANTS statements in MariaDB emit SQL built from stored metadata without escaping it, and mariadb-dump has similar gaps in its generated output. An attacker who controls a database could plant crafted identifiers or literals so that a privileged user who dumps and re-imports that database runs the attacker's SQL with elevated privileges.

MariaDB

Access control

Privilege escalation via user controlled usernames / roles and views

View and procedure definers are stored as raw option strings, so a username or role containing newline characters can inject extra definer options such as a different host or the suid flag. An attacker who controls their own username or role name could then run SQL with the privileges of another account, including reading the global privilege table.

MariaDB

RCE

#mysql50# legacy alias / internal table collisions

MariaDB's special handling of table names prefixed with #mysql50# skips the normal filename encoding, so an attacker can create table names containing characters such as # and newlines that collide with internal storage-engine files. This allows hidden tables, memory-corruption leading to remote code execution, and a merge-table trick that reads another database's table despite missing permissions.

MariaDB

RCE

#mysql50# legacy alias / stale table cache identity mismatch

MariaDB treats a table name and its legacy #mysql50# alias as separate identities in the SQL, metadata and cache layers even though both map to the same on-disk files. A low-privileged schema owner can open a table under one spelling and reshape it under the other, leaving stale table and field metadata that is later applied to attacker-controlled data, which the report chains into memory disclosure, privilege escalation and code execution.

MariaDB

Memory corruption

Heap Use-After-Free in Materialized_cursor::open via SYS_REFCURSOR Array Reallocation

A stored procedure cursor object holds pointers into a dynamic array of statement cursors; when a function called during the cursor's query opens enough additional cursors, the array reallocates and those pointers dangle. An authenticated user with CREATE FUNCTION privilege could then trigger a use-after-free that crashes the server and, in the author's view, may allow code execution through a virtual call on freed memory.

MariaDB

High