diff --git a/backport-CVE-2025-6021.patch b/backport-CVE-2025-6021.patch new file mode 100644 index 0000000000000000000000000000000000000000..5f3c34168f92af38a59e687debfe4e4082642952 --- /dev/null +++ b/backport-CVE-2025-6021.patch @@ -0,0 +1,46 @@ +From acbbeef9f5dcdcc901c5f3fa14d583ef8cfd22f0 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer +Date: Tue, 27 May 2025 12:53:17 +0200 +Subject: [PATCH] tree: Fix integer overflow in xmlBuildQName + +This issue affects memory safety and might receive a CVE ID later. + +Fixes #926. +--- + tree.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/tree.c b/tree.c +index b5a2659..d959172 100644 +--- a/tree.c ++++ b/tree.c +@@ -27,6 +27,7 @@ + #ifdef HAVE_STDLIB_H + #include + #endif ++#include + #ifdef LIBXML_ZLIB_ENABLED + #include + #endif +@@ -222,16 +223,18 @@ xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) { + xmlChar * + xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix, + xmlChar *memory, int len) { +- int lenn, lenp; ++ size_t lenn, lenp; + xmlChar *ret; + +- if (ncname == NULL) return(NULL); ++ if ((ncname == NULL) || (len < 0)) return(NULL); + if (prefix == NULL) return((xmlChar *) ncname); + + lenn = strlen((char *) ncname); + lenp = strlen((char *) prefix); ++ if (lenn >= SIZE_MAX - lenp - 1) ++ return(NULL); + +- if ((memory == NULL) || (len < lenn + lenp + 2)) { ++ if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) { + ret = (xmlChar *) xmlMallocAtomic(lenn + lenp + 2); + if (ret == NULL) { + xmlTreeErrMemory("building QName"); diff --git a/libxml2.spec b/libxml2.spec index 77e38d77a321af471a9a262285f9748cdf018812..9785bf7c39f92f7b037fcd07f7d26eed43d22913 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,7 +1,7 @@ Summary: Library providing XML and HTML support Name: libxml2 Version: 2.9.10 -Release: 45 +Release: 46 License: MIT Group: Development/Libraries Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz @@ -143,6 +143,7 @@ Patch130:backport-CVE-2025-24928.patch Patch131:backport-CVE-2025-27113.patch Patch132:backport-CVE-2025-32415.patch Patch133:backport-CVE-2025-32414.patch +Patch134:backport-CVE-2025-6021.patch BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: python2-devel @@ -334,6 +335,12 @@ rm -fr %{buildroot} %changelog +* Sat Jun 14 2025 Funda Wang - 2.9.10-46 +- Type:CVE +- CVE:CVE-2025-6021 +- SUG:NA +- DESC: fix CVE-2025-6021 + * Wed May 14 2025 Funda Wang - 2.9.10-45 - Type:CVE - CVE:CVE-2025-32414