From 1e50100e97bb2ef58f5a9b83a3fd1657fe202d3e Mon Sep 17 00:00:00 2001 From: Bo Liu Date: Tue, 5 Dec 2023 14:23:38 +0800 Subject: [PATCH] Fix CVE-2023-39615 Signed-off-by: Bo Liu --- libxml2-2.9.7-CVE-2023-39615.patch | 32 ++++++++++++++++++++++++++++++ libxml2.spec | 7 ++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 libxml2-2.9.7-CVE-2023-39615.patch diff --git a/libxml2-2.9.7-CVE-2023-39615.patch b/libxml2-2.9.7-CVE-2023-39615.patch new file mode 100644 index 0000000..50fba55 --- /dev/null +++ b/libxml2-2.9.7-CVE-2023-39615.patch @@ -0,0 +1,32 @@ +From d0c3f01e110d54415611c5fa0040cdf4a56053f9 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer +Date: Sat, 6 May 2023 17:47:37 +0200 +Subject: [PATCH] parser: Fix old SAX1 parser with custom callbacks + +For some reason, xmlCtxtUseOptionsInternal set the start and end element +SAX handlers to the internal DOM builder functions when XML_PARSE_SAX1 +was specified. This means that custom SAX handlers could never work with +that flag because these functions would receive the wrong user data +argument and crash immediately. + +Fixes #535. +--- + parser.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/parser.c b/parser.c +index bb05791d3..0c8bed129 100644 +--- a/parser.c ++++ b/parser.c +@@ -14479,8 +14479,6 @@ xmlCtxtUseOptionsInternal(xmlParserCtxtPtr ctxt, int options, const char *encodi + } + #ifdef LIBXML_SAX1_ENABLED + if (options & XML_PARSE_SAX1) { +- ctxt->sax->startElement = xmlSAX2StartElement; +- ctxt->sax->endElement = xmlSAX2EndElement; + ctxt->sax->startElementNs = NULL; + ctxt->sax->endElementNs = NULL; + ctxt->sax->initialized = 1; +-- +GitLab + diff --git a/libxml2.spec b/libxml2.spec index 0a7a9cd..ca8539b 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -9,7 +9,7 @@ Name: libxml2 Version: 2.9.7 -Release: 17%{anolis_release}%{?dist} +Release: 18%{anolis_release}%{?dist} Summary: Library providing XML and HTML support License: MIT @@ -62,6 +62,8 @@ Patch20: libxml2-2.9.7-CVE-2022-40304.patch Patch21: libxml2-2.9.7-CVE-2023-28484.patch # https://gitlab.gnome.org/GNOME/libxml2/-/commit/09a2dd453007f9c7205274623acdd73747c22d64.patch Patch22: libxml2-2.9.7-CVE-2023-29469.patch +# https://gitlab.gnome.org/GNOME/libxml2/-/commit/d0c3f01e110d54415611c5fa0040cdf4a56053f9 +Patch23: libxml2-2.9.7-CVE-2023-39615.patch # Add by Anolis Patch1000: 0001-modify-home-page.patch @@ -237,6 +239,9 @@ gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz %{python3_sitearch}/libxml2mod.so %changelog +* Tue Dec 05 2023 Bo Liu - 2.9.7-18.0.2 +- Fix CVE-2023-39615 + * Wed Sep 06 2023 chengshengyu - 2.9.7-17.0.2 - Fix CVE-2023-29469 (#2185984) -- Gitee