CVE Vulnerabilities

CVE-2022-24048

Stack-based Buffer Overflow

Published: Feb 18, 2022 | Modified: Nov 21, 2024
CVSS 3.x
7.8
HIGH
Source:
NVD
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
4.6 MEDIUM
AV:L/AC:L/Au:N/C:P/I:P/A:P
RedHat/V2
RedHat/V3
7.8 MODERATE
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Ubuntu
MEDIUM
root.io logo minimus.io logo echo.ai logo

MariaDB CONNECT Storage Engine Stack-based Buffer Overflow Privilege Escalation Vulnerability. This vulnerability allows local attackers to escalate privileges on affected installations of MariaDB. Authentication is required to exploit this vulnerability. The specific flaw exists within the processing of SQL queries. The issue results from the lack of proper validation of the length of user-supplied data prior to copying it to a fixed-length stack-based buffer. An attacker can leverage this vulnerability to escalate privileges and execute arbitrary code in the context of the service account. Was ZDI-CAN-16191.

Weakness

A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).

Affected Software

NameVendorStart VersionEnd Version
MariadbMariadb10.2.0 (including)10.2.42 (excluding)
MariadbMariadb10.3.0 (including)10.3.33 (excluding)
MariadbMariadb10.4.0 (including)10.4.23 (excluding)
MariadbMariadb10.5.0 (including)10.5.14 (excluding)
MariadbMariadb10.6.0 (including)10.6.6 (excluding)
MariadbMariadb10.7.0 (including)10.7.2 (excluding)
MariadbMariadb10.8.0 (including)10.8.0 (including)
Red Hat Enterprise Linux 8RedHatmariadb:10.5-8060020220614163302.ad008a3a*
Red Hat Enterprise Linux 8RedHatmariadb:10.3-8060020220715055054.ad008a3a*
Red Hat Enterprise Linux 8.4 Advanced Mission Critical Update SupportRedHatmariadb:10.5-8040020231006044227.522a0ee4*
Red Hat Enterprise Linux 8.4 Telecommunications Update ServiceRedHatmariadb:10.5-8040020231006044227.522a0ee4*
Red Hat Enterprise Linux 8.4 Update Services for SAP SolutionsRedHatmariadb:10.5-8040020231006044227.522a0ee4*
Red Hat Enterprise Linux 9RedHatmariadb-3:10.5.16-2.el9_0*
Red Hat Software Collections for Red Hat Enterprise Linux 7RedHatrh-mariadb105-mariadb-3:10.5.16-2.el7*
Red Hat Software Collections for Red Hat Enterprise Linux 7RedHatrh-mariadb103-mariadb-3:10.3.35-1.el7*
Mariadb-10.0Ubuntutrusty*
Mariadb-10.0Ubuntuxenial*
Mariadb-10.1Ubuntubionic*
Mariadb-10.1Ubuntutrusty*
Mariadb-10.1Ubuntuxenial*
Mariadb-10.3Ubuntuesm-apps/focal*
Mariadb-10.3Ubuntufocal*
Mariadb-10.3Ubuntutrusty*
Mariadb-10.3Ubuntuxenial*
Mariadb-10.5Ubuntuimpish*
Mariadb-10.5Ubuntutrusty*
Mariadb-10.5Ubuntuxenial*
Mariadb-10.6Ubuntukinetic*
Mariadb-10.6Ubuntulunar*
Mariadb-10.6Ubuntutrusty*
Mariadb-10.6Ubuntuxenial*
Mariadb-5.5Ubuntutrusty*
Mariadb-5.5Ubuntuxenial*

Potential Mitigations

  • Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking.
  • D3-SFCV (Stack Frame Canary Validation) from D3FEND [REF-1334] discusses canary-based detection in detail.
  • Run or compile the software using features or extensions that randomly arrange the positions of a program’s executable and libraries in memory. Because this makes the addresses unpredictable, it can prevent an attacker from reliably jumping to exploitable code.
  • Examples include Address Space Layout Randomization (ASLR) [REF-58] [REF-60] and Position-Independent Executables (PIE) [REF-64]. Imported modules may be similarly realigned if their default memory addresses conflict with other modules, in a process known as “rebasing” (for Windows) and “prelinking” (for Linux) [REF-1332] using randomly generated addresses. ASLR for libraries cannot be used in conjunction with prelink since it would require relocating the libraries at run-time, defeating the whole purpose of prelinking.
  • For more information on these techniques see D3-SAOR (Segment Address Offset Randomization) from D3FEND [REF-1335].

References