Summary
MariaDB Server contains a stack-based buffer overflow (CWE-121) in wsrep_store_key_val_for_row() (ha_innodb.cc). When building Galera certification keys (WSREP protocol version 2 or later), the function advances the destination pointer before copying a BLOB, TEXT or GEOMETRY key prefix, so the copy can run past the end of a 3500-byte stack buffer.
Per the CVSS vector, the attack is network-based, requires an authenticated low-privileged user, no user interaction, but high attack complexity. The attacker must be able to insert or update rows in an InnoDB table with a long BLOB/TEXT/GEOMETRY prefix in a key that WSREP serializes (primary, unique or foreign key, or any key of a table without a primary key) on a Galera cluster node.
The attacker can write up to about 3 KB of controlled data past the buffer, crashing the server or corrupting stack memory, with potentially high impact on confidentiality, integrity and availability. The vulnerability is not listed in the CISA KEV catalog.
Who is affected
Organizations running affected MariaDB Server versions in a Galera (WSREP) cluster, especially where users with write access can modify InnoDB tables.
What to do
- Upgrade MariaDB Server to the fixed release of your branch: 10.6.25, 10.11.16, 11.4.10, 11.8.6 or 12.2.2 (or later).
- Identify servers acting as Galera/WSREP nodes (e.g. wsrep_on enabled) and check their MariaDB versions.
- Identify InnoDB tables with long BLOB/TEXT/GEOMETRY prefixes in primary, unique or foreign keys, and tables without a primary key.
- Until patched, restrict INSERT/UPDATE privileges on such tables to necessary accounts only and monitor for unexpected node crashes.
- Follow MDEV-38374 and official MariaDB advisories for further information.
Affected products and versions
CVSS vector, explained
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- Network (from the internet)
- Attack complexity
- High
- Privileges required
- Regular user
- User interaction
- Not required
- Scope
- Vulnerable component only
- Confidentiality
- High impact
- Integrity
- High impact
- Availability
- High impact
Weakness type (CWE)
- CWE-121 Stack-based Buffer Overflow
References
- jira.mariadb.org/browse/MDEV-38374
- github.com/MariaDB/server/commit/2dcd3cefe1f50366ab9f4cce5325483b43e5efcc
Sources: CVE.org (CNA and CISA ADP), CISA KEV, FIRST EPSS. Always check the vendor's official advisory.