summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorDivya Chellam <divya.chellam@windriver.com>2025-10-24 17:56:24 +0530
committerGyorgy Sarvari <skandigraun@gmail.com>2025-10-27 11:17:59 +0100
commit3c55e66f1fc7324c266324798a6c6aa94c5048d0 (patch)
tree44f30b20231090f9365f884c675d628235ea7f88 /meta-oe
parent6306bae883db86f1bb1f79a8f672f00bc114a9be (diff)
downloadmeta-openembedded-3c55e66f1fc7324c266324798a6c6aa94c5048d0.tar.gz
mariadb: fix CVE-2025-30722
Vulnerability in the MySQL Client product of Oracle MySQL (component: Client: mysqldump). Supported versions that are affected are 8.0.0-8.0.41, 8.4.0-8.4.4 and 9.0.0-9.2.0. Difficult to exploit vulnerability allows low privileged attacker with network access via multiple protocols to compromise MySQL Client. Successful attacks of this vulnerability can result in unauthorized access to critical data or complete access to all MySQL Client accessible data as well as unauthorized update, insert or delete access to some of MySQL Client accessible data. CVSS 3.1 Base Score 5.9 (Confidentiality and Integrity impacts). CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N). Reference: https://security-tracker.debian.org/tracker/CVE-2025-30722 Upstream-patch: https://github.com/MariaDB/server/commit/6aa860be27480db134a3c71065b9b47d15b72674 Signed-off-by: Divya Chellam <divya.chellam@windriver.com> Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb.inc1
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb/CVE-2025-30722.patch176
2 files changed, 177 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc
index 27b5c46fa1..048e43d962 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb.inc
+++ b/meta-oe/recipes-dbs/mysql/mariadb.inc
@@ -34,6 +34,7 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
34 file://CVE-2024-21096-0004.patch \ 34 file://CVE-2024-21096-0004.patch \
35 file://CVE-2024-21096-0005.patch \ 35 file://CVE-2024-21096-0005.patch \
36 file://CVE-2025-21490.patch \ 36 file://CVE-2025-21490.patch \
37 file://CVE-2025-30722.patch \
37 " 38 "
38SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch" 39SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch"
39 40
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/CVE-2025-30722.patch b/meta-oe/recipes-dbs/mysql/mariadb/CVE-2025-30722.patch
new file mode 100644
index 0000000000..d7e74d66f0
--- /dev/null
+++ b/meta-oe/recipes-dbs/mysql/mariadb/CVE-2025-30722.patch
@@ -0,0 +1,176 @@
1From 6aa860be27480db134a3c71065b9b47d15b72674 Mon Sep 17 00:00:00 2001
2From: Sergei Golubchik <serg@mariadb.org>
3Date: Tue, 11 Mar 2025 11:22:00 +0100
4Subject: [PATCH] MDEV-36268 mariadb-dump used wrong quoting character
5
6use ' not " and use quote_for_equal()
7
8Backported according to mariadb 10.11.12
9
10CVE: CVE-2025-30722
11
12Upstream-Status: Backport [https://github.com/MariaDB/server/commit/6aa860be27480db134a3c71065b9b47d15b72674]
13
14Signed-off-by: Divya Chellam <divya.chellam@windriver.com>
15---
16 client/mysqldump.c | 15 +++++++----
17 mysql-test/main/mysqldump-system.result | 6 ++---
18 mysql-test/main/mysqldump.result | 33 +++++++++++++++++++++++++
19 mysql-test/main/mysqldump.test | 9 +++++++
20 4 files changed, 55 insertions(+), 8 deletions(-)
21
22diff --git a/client/mysqldump.c b/client/mysqldump.c
23index 767413b1..9c0921c0 100644
24--- a/client/mysqldump.c
25+++ b/client/mysqldump.c
26@@ -2175,7 +2175,7 @@ static char *quote_for_equal(const char *name, char *buff)
27 *to++='\\';
28 }
29 if (*name == '\'')
30- *to++= '\\';
31+ *to++= '\'';
32 *to++= *name++;
33 }
34 to[0]= '\'';
35@@ -3707,7 +3707,7 @@ static void dump_trigger_old(FILE *sql_file, MYSQL_RES *show_triggers_rs,
36
37 fprintf(sql_file,
38 "DELIMITER ;;\n"
39- "/*!50003 SET SESSION SQL_MODE=\"%s\" */;;\n"
40+ "/*!50003 SET SESSION SQL_MODE='%s' */;;\n"
41 "/*!50003 CREATE */ ",
42 (*show_trigger_row)[6]);
43
44@@ -4686,17 +4686,19 @@ static int dump_all_users_roles_and_grants()
45 return 1;
46 while ((row= mysql_fetch_row(tableres)))
47 {
48+ char buf[200];
49 if (opt_replace_into)
50 /* Protection against removing the current import user */
51 /* MySQL-8.0 export capability */
52 fprintf(md_result_file,
53 "DELIMITER |\n"
54- "/*M!100101 IF current_user()=\"%s\" THEN\n"
55+ "/*M!100101 IF current_user()=%s THEN\n"
56 " SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001,"
57 " MESSAGE_TEXT=\"Don't remove current user %s'\";\n"
58 "END IF */|\n"
59 "DELIMITER ;\n"
60- "/*!50701 DROP USER IF EXISTS %s */;\n", row[0], row[0], row[0]);
61+ "/*!50701 DROP USER IF EXISTS %s */;\n",
62+ quote_for_equal(row[0],buf), row[0], row[0]);
63 if (dump_create_user(row[0]))
64 result= 1;
65 /* if roles exist, defer dumping grants until after roles created */
66@@ -6770,6 +6772,7 @@ static my_bool get_view_structure(char *table, char* db)
67 char *result_table, *opt_quoted_table;
68 char table_buff[NAME_LEN*2+3];
69 char table_buff2[NAME_LEN*2+3];
70+ char temp_buff[NAME_LEN*2 + 3], temp_buff2[NAME_LEN*2 + 3];
71 char query[QUERY_LENGTH];
72 FILE *sql_file= md_result_file;
73 DBUG_ENTER("get_view_structure");
74@@ -6830,7 +6833,9 @@ static my_bool get_view_structure(char *table, char* db)
75 "SELECT CHECK_OPTION, DEFINER, SECURITY_TYPE, "
76 " CHARACTER_SET_CLIENT, COLLATION_CONNECTION "
77 "FROM information_schema.views "
78- "WHERE table_name=\"%s\" AND table_schema=\"%s\"", table, db);
79+ "WHERE table_name=%s AND table_schema=%s",
80+ quote_for_equal(table, temp_buff2),
81+ quote_for_equal(db, temp_buff));
82
83 if (mysql_query(mysql, query))
84 {
85diff --git a/mysql-test/main/mysqldump-system.result b/mysql-test/main/mysqldump-system.result
86index 5619ec70..b502bd8d 100644
87--- a/mysql-test/main/mysqldump-system.result
88+++ b/mysql-test/main/mysqldump-system.result
89@@ -648,21 +648,21 @@ INSTALL PLUGIN test_plugin_server SONAME 'AUTH_TEST_PLUGIN_LIB';
90 /*M!100401 UNINSTALL PLUGIN IF EXIST cleartext_plugin_server */;
91 INSTALL PLUGIN cleartext_plugin_server SONAME 'AUTH_TEST_PLUGIN_LIB';
92 DELIMITER |
93-/*M!100101 IF current_user()="'mariadb.sys'@'localhost'" THEN
94+/*M!100101 IF current_user()='''mariadb.sys''@''localhost''' THEN
95 SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'mariadb.sys'@'localhost''";
96 END IF */|
97 DELIMITER ;
98 /*!50701 DROP USER IF EXISTS 'mariadb.sys'@'localhost' */;
99 CREATE /*M!100103 OR REPLACE */ USER `mariadb.sys`@`localhost` PASSWORD EXPIRE;
100 DELIMITER |
101-/*M!100101 IF current_user()="'root'@'localhost'" THEN
102+/*M!100101 IF current_user()='''root''@''localhost''' THEN
103 SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'root'@'localhost''";
104 END IF */|
105 DELIMITER ;
106 /*!50701 DROP USER IF EXISTS 'root'@'localhost' */;
107 CREATE /*M!100103 OR REPLACE */ USER `root`@`localhost`;
108 DELIMITER |
109-/*M!100101 IF current_user()="'foobar'@'%'" THEN
110+/*M!100101 IF current_user()='''foobar'@'%''' THEN
111 SIGNAL SQLSTATE '45000' SET MYSQL_ERRNO=30001, MESSAGE_TEXT="Don't remove current user 'foobar'@'%''";
112 END IF */|
113 DELIMITER ;
114diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result
115index ca9260f1..c55e5e49 100644
116--- a/mysql-test/main/mysqldump.result
117+++ b/mysql-test/main/mysqldump.result
118@@ -6699,4 +6699,37 @@ CREATE TABLE `t1` (
119 /*!40101 SET character_set_client = @saved_cs_client */;
120 ERROR at line 9: Not allowed in the sandbox mode
121 drop table t1;
122+#
123+# MDEV-36268 mariadb-dump used wrong quoting character
124+#
125+create table t1 (a int);
126+create view `v'1"2` as select * from t1 with check option;
127+/*M!999999\- enable the sandbox mode */
128+/*!40101 SET @saved_cs_client = @@character_set_client */;
129+/*!40101 SET character_set_client = utf8mb4 */;
130+CREATE TABLE `t1` (
131+ `a` int(11) DEFAULT NULL
132+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
133+/*!40101 SET character_set_client = @saved_cs_client */;
134+SET @saved_cs_client = @@character_set_client;
135+SET character_set_client = utf8mb4;
136+/*!50001 CREATE VIEW `v'1"2` AS SELECT
137+ 1 AS `a` */;
138+SET character_set_client = @saved_cs_client;
139+/*!50001 DROP VIEW IF EXISTS `v'1"2`*/;
140+/*!50001 SET @saved_cs_client = @@character_set_client */;
141+/*!50001 SET @saved_cs_results = @@character_set_results */;
142+/*!50001 SET @saved_col_connection = @@collation_connection */;
143+/*!50001 SET character_set_client = utf8 */;
144+/*!50001 SET character_set_results = utf8 */;
145+/*!50001 SET collation_connection = utf8_general_ci */;
146+/*!50001 CREATE ALGORITHM=UNDEFINED */
147+/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
148+/*!50001 VIEW `v'1"2` AS select `t1`.`a` AS `a` from `t1` */
149+/*!50002 WITH CASCADED CHECK OPTION */;
150+/*!50001 SET character_set_client = @saved_cs_client */;
151+/*!50001 SET character_set_results = @saved_cs_results */;
152+/*!50001 SET collation_connection = @saved_col_connection */;
153+drop view `v'1"2`;
154+drop table t1;
155 # End of 10.5 tests
156diff --git a/mysql-test/main/mysqldump.test b/mysql-test/main/mysqldump.test
157index 9248f2ac..64d73ad3 100644
158--- a/mysql-test/main/mysqldump.test
159+++ b/mysql-test/main/mysqldump.test
160@@ -3003,4 +3003,13 @@ EOF
161 --remove_file $MYSQLTEST_VARDIR/tmp/mdev33727.sql
162 drop table t1;
163
164+--echo #
165+--echo # MDEV-36268 mariadb-dump used wrong quoting character
166+--echo #
167+create table t1 (a int);
168+create view `v'1"2` as select * from t1 with check option; # "'
169+--exec $MYSQL_DUMP --compact test
170+drop view `v'1"2`; # "'
171+drop table t1;
172+
173 --echo # End of 10.5 tests
174--
1752.40.0
176