From cacc39cb49f5d05cf264a2c668a8cdecc88fe479 Mon Sep 17 00:00:00 2001 From: liweigang Date: Mon, 5 Feb 2024 11:02:18 +0800 Subject: [PATCH] fix CVE-2024-25062 Signed-off-by: liweigang --- backport-CVE-2024-25062.patch | 29 +++++++++++++++++++++++++++++ libxml2.spec | 9 ++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 backport-CVE-2024-25062.patch diff --git a/backport-CVE-2024-25062.patch b/backport-CVE-2024-25062.patch new file mode 100644 index 0000000..88e3e35 --- /dev/null +++ b/backport-CVE-2024-25062.patch @@ -0,0 +1,29 @@ +From 2b0aac140d739905c7848a42efc60bfe783a39b7 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer +Date: Sat, 14 Oct 2023 22:45:54 +0200 +Subject: [PATCH] [CVE-2024-25062] xmlreader: Don't expand XIncludes when + backtracking + +Fixes a use-after-free if XML Reader if used with DTD validation and +XInclude expansion. + +Fixes #604. +--- + xmlreader.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/xmlreader.c b/xmlreader.c +index 979385a13..fefd68e0b 100644 +--- a/xmlreader.c ++++ b/xmlreader.c +@@ -1443,6 +1443,7 @@ node_found: + * Handle XInclude if asked for + */ + if ((reader->xinclude) && (reader->in_xinclude == 0) && ++ (reader->state != XML_TEXTREADER_BACKTRACK) && + (reader->node != NULL) && + (reader->node->type == XML_ELEMENT_NODE) && + (reader->node->ns != NULL) && +-- +GitLab + diff --git a/libxml2.spec b/libxml2.spec index 3e10615..295ab99 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,7 +1,7 @@ Summary: Library providing XML and HTML support Name: libxml2 Version: 2.11.5 -Release: 1 +Release: 2 License: MIT Group: Development/Libraries Source: https://download.gnome.org/sources/%{name}/2.11/%{name}-%{version}.tar.xz @@ -10,6 +10,7 @@ Patch0: libxml2-multilib.patch Patch1: backport-CVE-2023-45322.patch Patch2: backport-xpath-Remove-remaining-references-to-valueFrame.patch Patch3: backport-examples-Don-t-call-xmlCleanupParser-and-xmlMemoryDu.patch +Patch4: backport-CVE-2024-25062.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: python3-devel @@ -161,6 +162,12 @@ rm -fr %{buildroot} %changelog +* Mon Feb 05 2024 Paul Thomas - 2.11.5-2 +- Type:CVE +- CVE:CVE-2024-25062 +- SUG:NA +- DESC:fix CVE-2024-25062 + * Mon Jan 29 2024 zhuofeng - 2.11.5-1 - Type:bugfix - CVE:NA