Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2022-27383: [MDEV-26323] use-after-poison issue of MariaDB server

MariaDB Server v10.6 and below was discovered to contain an use-after-free in the component my_strcasecmp_8bit, which is exploited via specially crafted SQL statements.

CVE
#sql#linux

step to reproduce:

INSTALL PLUGIN DEALLOCATE SONAME ‘x’ ;

asan report:

Version: ‘10.6.5-MariaDB’ socket: ‘/tmp/mysql_mar.sock’ port: 3309 Source distribution

=================================================================

==283607==ERROR: AddressSanitizer: use-after-poison on address 0x62b000077306 at pc 0x56165517504e bp 0x7f3e39319c80 sp 0x7f3e39319c70

READ of size 1 at 0x62b000077306 thread T48

#0 0x56165517504d in my\_strcasecmp\_8bit /home/supersix/fuzz/security/MariaDB/server/strings/ctype-simple.c:265

#1 0x561653282063 in fix\_dl\_name /home/supersix/fuzz/security/MariaDB/server/sql/sql\_plugin.cc:376

#2 0x561653282063 in plugin\_add /home/supersix/fuzz/security/MariaDB/server/sql/sql\_plugin.cc:1125

#3 0x561653293f30 in mysql\_install\_plugin(THD\*, st\_mysql\_const\_lex\_string const\*, st\_mysql\_const\_lex\_string const\*) /home/supersix/fuzz/security/MariaDB/server/sql/sql\_plugin.cc:2270

#4 0x56165326a1df in mysql\_execute\_command(THD\*, bool) /home/supersix/fuzz/security/MariaDB/server/sql/sql\_parse.cc:5899

#5 0x561653225684 in mysql\_parse(THD\*, char\*, unsigned int, Parser\_state\*) /home/supersix/fuzz/security/MariaDB/server/sql/sql\_parse.cc:8030

#6 0x56165325b0b3 in dispatch\_command(enum\_server\_command, THD\*, char\*, unsigned int, bool) /home/supersix/fuzz/security/MariaDB/server/sql/sql\_parse.cc:1896

#7 0x561653260513 in do\_command(THD\*, bool) /home/supersix/fuzz/security/MariaDB/server/sql/sql\_parse.cc:1404

#8 0x5616537226fc in do\_handle\_one\_connection(CONNECT\*, bool) /home/supersix/fuzz/security/MariaDB/server/sql/sql\_connect.cc:1418

#9 0x561653723e56 in handle\_one\_connection /home/supersix/fuzz/security/MariaDB/server/sql/sql\_connect.cc:1312

#10 0x56165456fd2f in pfs\_spawn\_thread /home/supersix/fuzz/security/MariaDB/server/storage/perfschema/pfs.cc:2201

#11 0x7f3e5895a608 in start\_thread /build/glibc-ZN95T4/glibc-2.31/nptl/pthread\_create.c:477

#12 0x7f3e5852e292 in \_\_clone (/lib/x86\_64-linux-gnu/libc.so.6+0x122292)

0x62b000077306 is located 262 bytes inside of 24624-byte region [0x62b000077200,0x62b00007d230)

allocated by thread T48 here:

#0 0x7f3e58ee5bc8 in malloc (/lib/x86\_64-linux-gnu/libasan.so.5+0x10dbc8)

#1 0x5616550fbc1c in my\_malloc /home/supersix/fuzz/security/MariaDB/server/mysys/my\_malloc.c:90

#2 0x5616550e28c8 in reset\_root\_defaults /home/supersix/fuzz/security/MariaDB/server/mysys/my\_alloc.c:148

#3 0x5616530d2773 in THD::init\_for\_queries() /home/supersix/fuzz/security/MariaDB/server/sql/sql\_class.cc:1406

#4 0x5616537201ea in prepare\_new\_connection\_state(THD\*) /home/supersix/fuzz/security/MariaDB/server/sql/sql\_connect.cc:1240

#5 0x561653720efa in thd\_prepare\_connection(THD\*) /home/supersix/fuzz/security/MariaDB/server/sql/sql\_connect.cc:1333

#6 0x561653720efa in thd\_prepare\_connection(THD\*) /home/supersix/fuzz/security/MariaDB/server/sql/sql\_connect.cc:1322

#7 0x561653722663 in do\_handle\_one\_connection(CONNECT\*, bool) /home/supersix/fuzz/security/MariaDB/server/sql/sql\_connect.cc:1408

#8 0x561653723e56 in handle\_one\_connection /home/supersix/fuzz/security/MariaDB/server/sql/sql\_connect.cc:1312

#9 0x56165456fd2f in pfs\_spawn\_thread /home/supersix/fuzz/security/MariaDB/server/storage/perfschema/pfs.cc:2201

#10 0x7f3e5895a608 in start\_thread /build/glibc-ZN95T4/glibc-2.31/nptl/pthread\_create.c:477

Thread T48 created by T0 here:

#0 0x7f3e58e12805 in pthread\_create (/lib/x86\_64-linux-gnu/libasan.so.5+0x3a805)

#1 0x56165456ffe2 in my\_thread\_create /home/supersix/fuzz/security/MariaDB/server/storage/perfschema/my\_thread.h:48

#2 0x56165456ffe2 in pfs\_spawn\_thread\_v1 /home/supersix/fuzz/security/MariaDB/server/storage/perfschema/pfs.cc:2252

#3 0x561652ef4b48 in inline\_mysql\_thread\_create /home/supersix/fuzz/security/MariaDB/server/include/mysql/psi/mysql\_thread.h:1139

#4 0x561652ef4b48 in create\_thread\_to\_handle\_connection(CONNECT\*) /home/supersix/fuzz/security/MariaDB/server/sql/mysqld.cc:5922

#5 0x561652f04235 in handle\_accepted\_socket(st\_mysql\_socket, st\_mysql\_socket) /home/supersix/fuzz/security/MariaDB/server/sql/mysqld.cc:6043

#6 0x561652f0500e in handle\_connections\_sockets() /home/supersix/fuzz/security/MariaDB/server/sql/mysqld.cc:6167

#7 0x561652f0719b in mysqld\_main(int, char\*\*) /home/supersix/fuzz/security/MariaDB/server/sql/mysqld.cc:5817

#8 0x7f3e584330b2 in \_\_libc\_start\_main (/lib/x86\_64-linux-gnu/libc.so.6+0x270b2)

SUMMARY: AddressSanitizer: use-after-poison /home/supersix/fuzz/security/MariaDB/server/strings/ctype-simple.c:265 in my_strcasecmp_8bit

Shadow bytes around the buggy address:

0x0c5680006e10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

0x0c5680006e20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

0x0c5680006e30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa

0x0c5680006e40: 00 00 00 00 00 00 f7 00 00 00 00 00 00 00 00 00

0x0c5680006e50: 00 00 00 00 00 00 03 f7 00 00 00 00 05 f7 00 03

=>0x0c5680006e60:[f7]02 f7 00 00 00 00 00 00 00 f7 f7 f7 f7 f7 f7

0x0c5680006e70: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7

0x0c5680006e80: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7

0x0c5680006e90: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7

0x0c5680006ea0: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7

0x0c5680006eb0: f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7 f7

Shadow byte legend (one shadow byte represents 8 application bytes):

Addressable: 00

Partially addressable: 01 02 03 04 05 06 07

Heap left redzone: fa

Freed heap region: fd

Stack left redzone: f1

Stack mid redzone: f2

Stack right redzone: f3

Stack after return: f5

Stack use after scope: f8

Global redzone: f9

Global init order: f6

Poisoned by user: f7

Container overflow: fc

Array cookie: ac

Intra object redzone: bb

ASan internal: fe

Left alloca redzone: ca

Right alloca redzone: cb

Shadow gap: cc

==283607==ABORTING

Related news

Gentoo Linux Security Advisory 202405-25

Gentoo Linux Security Advisory 202405-25 - Multiple vulnerabilities have been discovered in MariaDB, the worst fo which can lead to arbitrary execution of code. Versions greater than or equal to 10.11.3:10.11 are affected.

Ubuntu Security Notice USN-5739-1

Ubuntu Security Notice 5739-1 - Several security issues were discovered in MariaDB and this update includes new upstream MariaDB versions to fix these issues. MariaDB has been updated to 10.3.37 in Ubuntu 20.04 LTS and to 10.6.11 in Ubuntu 22.04 LTS and Ubuntu 22.10. In addition to security fixes, the updated packages contain bug fixes, new features, and possibly incompatible changes.

Red Hat Security Advisory 2022-6443-01

Red Hat Security Advisory 2022-6443-01 - MariaDB is a multi-user, multi-threaded SQL database server that is binary compatible with MySQL. Issues addressed include buffer overflow and use-after-free vulnerabilities.

RHSA-2022:6443: Red Hat Security Advisory: mariadb:10.3 security and bug fix update

An update for the mariadb:10.3 module is now available for Red Hat Enterprise Linux 8. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section.This content is licensed under the Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0/). If you distribute this content, or a modified version of it, you must provide attribution to Red Hat Inc. and provide a link to the original. Related CVEs: * CVE-2021-46659: mariadb: Crash executing query with VIEW, aggregate and subquery * CVE-2021-46661: mariadb: MariaDB allows an application crash in find_field_in_tables and find_order_in_list via an unused common table expression (CTE) * CVE-2021-46663: mariadb: MariaDB through 10.5.13 allows a ha_maria::extra application crash via certain SELECT ...

Red Hat Security Advisory 2022-6306-01

Red Hat Security Advisory 2022-6306-01 - MariaDB is a multi-user, multi-threaded SQL database server. For all practical purposes, MariaDB is binary-compatible with MySQL. Issues addressed include buffer overflow and use-after-free vulnerabilities.

RHSA-2022:6306: Red Hat Security Advisory: rh-mariadb103-galera and rh-mariadb103-mariadb security and bug fix update

An update for rh-mariadb103-galera and rh-mariadb103-mariadb is now available for Red Hat Software Collections. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section.This content is licensed under the Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0/). If you distribute this content, or a modified version of it, you must provide attribution to Red Hat Inc. and provide a link to the original. Related CVEs: * CVE-2021-46659: mariadb: Crash executing query with VIEW, aggregate and subquery * CVE-2021-46661: mariadb: MariaDB allows an application crash in find_field_in_tables and find_order_in_list via an unused common table expression (CTE) * CVE-2021-46663: mariadb: MariaDB through 10.5.13 allows a ha_maria::extra application ...

RHSA-2022:5948: Red Hat Security Advisory: galera, mariadb, and mysql-selinux security, bug fix, and enhancement update

An update for galera, mariadb, and mysql-selinux is now available for Red Hat Enterprise Linux 9. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section.This content is licensed under the Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0/). If you distribute this content, or a modified version of it, you must provide attribution to Red Hat Inc. and provide a link to the original. Related CVEs: * CVE-2021-46659: mariadb: Crash executing query with VIEW, aggregate and subquery * CVE-2021-46661: mariadb: MariaDB allows an application crash in find_field_in_tables and find_order_in_list via an unused common table expression (CTE) * CVE-2021-46663: mariadb: MariaDB through 10.5.13 allows a ha_maria::extra application crash via cert...

RHSA-2022:5826: Red Hat Security Advisory: mariadb:10.5 security, bug fix, and enhancement update

An update for the mariadb:10.5 module is now available for Red Hat Enterprise Linux 8. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section.This content is licensed under the Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0/). If you distribute this content, or a modified version of it, you must provide attribution to Red Hat Inc. and provide a link to the original. Related CVEs: * CVE-2021-46659: mariadb: Crash executing query with VIEW, aggregate and subquery * CVE-2021-46661: mariadb: MariaDB allows an application crash in find_field_in_tables and find_order_in_list via an unused common table expression (CTE) * CVE-2021-46663: mariadb: MariaDB through 10.5.13 allows a ha_maria::extra application crash via certain SELECT ...

RHSA-2022:5759: Red Hat Security Advisory: rh-mariadb105-galera and rh-mariadb105-mariadb security and bugfix update

An update for rh-mariadb105-galera and rh-mariadb105-mariadb is now available for Red Hat Software Collections. Red Hat Product Security has rated this update as having a security impact of Moderate. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available for each vulnerability from the CVE link(s) in the References section.This content is licensed under the Creative Commons Attribution 4.0 International License (https://creativecommons.org/licenses/by/4.0/). If you distribute this content, or a modified version of it, you must provide attribution to Red Hat Inc. and provide a link to the original. Related CVEs: * CVE-2021-46659: mariadb: Crash executing query with VIEW, aggregate and subquery * CVE-2021-46661: mariadb: MariaDB allows an application crash in find_field_in_tables and find_order_in_list via an unused common table expression (CTE) * CVE-2021-46663: mariadb: MariaDB through 10.5.13 allows a ha_maria::extra application ...

CVE-2022-24052: Security Vulnerabilities Fixed in MariaDB

MariaDB CONNECT Storage Engine Heap-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 heap-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-16190.

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda
CVE-2023-6905
CVE-2023-6903
CVE-2023-6904
CVE-2023-3907