From fbf439343689045e2b0eb08f76f84a8d0a328a4d Mon Sep 17 00:00:00 2001 From: xuraoqing Date: Fri, 18 Jul 2025 06:17:02 +0000 Subject: [PATCH] fix CVE-2025-7519 Signed-off-by: xuraoqing (cherry picked from commit a0ee8727ff3895d979d18b794a319902dde3619d) --- ...iles-cause-xml-parsing-overflow-lead.patch | 32 +++++++++++++++++++ polkit.spec | 6 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 backport-CVE-2025-7519-Nested-.policy-files-cause-xml-parsing-overflow-lead.patch diff --git a/backport-CVE-2025-7519-Nested-.policy-files-cause-xml-parsing-overflow-lead.patch b/backport-CVE-2025-7519-Nested-.policy-files-cause-xml-parsing-overflow-lead.patch new file mode 100644 index 0000000..fa04707 --- /dev/null +++ b/backport-CVE-2025-7519-Nested-.policy-files-cause-xml-parsing-overflow-lead.patch @@ -0,0 +1,32 @@ +From 107d3801361b9f9084f78710178e683391f1d245 Mon Sep 17 00:00:00 2001 +From: Jan Rybar +Date: Fri, 6 Jun 2025 13:25:55 +0200 +Subject: [PATCH] Nested .policy files cause xml parsing overflow leading to + crash + +Reference:https://github.com/polkit-org/polkit/commit/107d3801361b9f9084f78710178e683391f1d245 +Conflict:NA + +--- + src/polkitbackend/polkitbackendactionpool.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/polkitbackend/polkitbackendactionpool.c b/src/polkitbackend/polkitbackendactionpool.c +index 43f89cb..f4acca9 100644 +--- a/src/polkitbackend/polkitbackendactionpool.c ++++ b/src/polkitbackend/polkitbackendactionpool.c +@@ -739,6 +739,12 @@ _start (void *data, const char *el, const char **attr) + guint num_attr; + ParserData *pd = data; + ++ if (pd->stack_depth < 0 || pd->stack_depth >= PARSER_MAX_DEPTH) ++ { ++ g_warning ("XML parsing reached max depth?"); ++ goto error; ++ } ++ + for (num_attr = 0; attr[num_attr] != NULL; num_attr++) + ; + +-- +2.33.0 \ No newline at end of file diff --git a/polkit.spec b/polkit.spec index 7a9432d..b263236 100644 --- a/polkit.spec +++ b/polkit.spec @@ -1,12 +1,13 @@ Name: polkit Version: 123 -Release: 1 +Release: 2 Summary: Define and Handle authorizations tool License: LGPLv2+ URL: http://www.freedesktop.org/wiki/Software/polkit Source0: https://gitlab.freedesktop.org/polkit/polkit/-/archive/%{version}/%{name}-%{version}.tar.gz Patch0: modify-admin-authorization-from-wheel-group-to-root.patch +Patch1: backport-CVE-2025-7519-Nested-.policy-files-cause-xml-parsing-overflow-lead.patch BuildRequires: gcc-c++ glib2-devel >= 2.30.0 expat-devel pam-devel gtk-doc gettext-devel BuildRequires: gobject-introspection-devel systemd systemd-devel dbus-devel @@ -122,6 +123,9 @@ exit 0 %{_datadir}/man/man8/* %changelog +* Fri Jul 18 2025 xuraoqing - 123-2 +- fix CVE-2025-7519 + * Tue Jan 30 2024 wangyu - 123-1 - update to 123 - duktape:prevent wrongful termination of runway thread -- Gitee