REDHAT-BUG-2590560: Buffer Overflow
MariaDB Server before 10.6.25, 10.7 through 10.11.x before 10.11.16, 11.0 through 11.4.x before 11.4.10, 11.5 through 11.8.x before 11.8.6, and 12.0 through 12.2.x before 12.2.2 contains a stack-based buffer overflow in wsrepstorekeyvalforrow() in storage/innobase/handler/hainnodb.cc. When building Galera write-set certification keys with WSREP protocol version 2 or later, the function advanced the destination pointer past a BLOB, TEXT or GEOMETRY key prefix before copying the prefix bytes, so the copy landed after the space reserved for it and could run past the end of the 3500-byte key buffer on the stack of hainnobase::wsrepappendkeys(). Authenticated users who can insert or update rows in an InnoDB table with a long BLOB, TEXT or GEOMETRY prefix in a key that WSREP serializes (a primary, unique or foreign key, or any key of a table without a primary key) on a Galera cluster node can write up to about 3 KB of data they control past the buffer, crashing the server or corrupting stack memory.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 10.6.25 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 10.11.16 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 11.4.10 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 11.8.6 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 12.2.2
Event History
Frequently Asked Questions
Which deployments are exposed to this issue?
Exposure requires a MariaDB Galera cluster node using WSREP protocol version 2 or later. The affected operation must involve an InnoDB table and a key that Galera serializes, including a primary, unique, or foreign key, or any key on a table without a primary key.
What access does an attacker need?
An attacker must be authenticated and able to insert or update rows in a relevant InnoDB table. Exploitation also requires supplying a long BLOB, TEXT, or GEOMETRY key prefix in a serialized key.
What is the likely impact of successful exploitation?
The flaw can allow an authenticated user to write approximately 3 KB of controlled data past a stack buffer. This can crash the MariaDB server or corrupt stack memory.
Which MariaDB versions need to be updated?
Update to 10.6.25, 10.11.16, 11.4.10, 11.8.6, or 12.2.2 or later, as applicable to the deployed release line. Versions in the affected ranges before those releases are vulnerable.
How can I identify systems that warrant priority review?
Prioritize Galera nodes running an affected MariaDB version with WSREP protocol version 2 or later. Review InnoDB tables that permit untrusted inserts or updates and have BLOB, TEXT, or GEOMETRY prefixes in primary, unique, foreign, or other serialized keys.