From b0d0f5e8a5860b98d734010e262f096ddb2f05ee Mon Sep 17 00:00:00 2001 From: David King Date: Thu, 14 Sep 2023 12:57:53 +0100 Subject: [PATCH] Fix CVE-2023-39615 (RHEL-5180) Resolves: RHEL-5180 --- libxml2-2.11.0-fix-CVE-2023-39615.patch | 32 +++++++++++++++++++++++++ libxml2.spec | 7 +++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 libxml2-2.11.0-fix-CVE-2023-39615.patch diff --git a/libxml2-2.11.0-fix-CVE-2023-39615.patch b/libxml2-2.11.0-fix-CVE-2023-39615.patch new file mode 100644 index 0000000..50fba55 --- /dev/null +++ b/libxml2-2.11.0-fix-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 0a8bb43..f863ac0 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,6 +1,6 @@ Name: libxml2 Version: 2.9.13 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Library providing XML and HTML support License: MIT @@ -20,6 +20,8 @@ Patch4: libxml2-2.9.13-CVE-2022-40304.patch Patch5: libxml2-2.9.13-CVE-2023-28484.patch Patch6: libxml2-2.9.13-CVE-2023-28484.2.patch Patch7: libxml2-2.9.13-CVE-2023-29469.patch +# https://issues.redhat.com/browse/RHEL-5180 +Patch8: libxml2-2.11.0-fix-CVE-2023-39615.patch BuildRequires: cmake-rpm-macros BuildRequires: gcc @@ -148,6 +150,9 @@ gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz %{python3_sitearch}/libxml2mod.so %changelog +* Thu Sep 14 2023 David King - 2.9.13-5 +- Fix CVE-2023-39615 (RHEL-5180) + * Fri Apr 14 2023 David King - 2.9.13-4 - Fix CVE-2023-28484 (#2186694) - Fix CVE-2023-29469 (#2186694)