Fix CVE-2022-49043 (RHEL-76289)

Resolves: RHEL-76289
This commit is contained in:
David King 2025-02-11 12:15:21 +00:00
parent 44169a222c
commit ba13a44374
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From 6bb146a3ea24a9bacfad6fe67268f0404af37d9c Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Wed, 2 Nov 2022 16:13:27 +0100
Subject: [PATCH] malloc-fail: Fix use-after-free in xmlXIncludeAddNode
Found with libFuzzer, see #344.
---
xinclude.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xinclude.c b/xinclude.c
index 2a0614d7..e32b3419 100644
--- a/xinclude.c
+++ b/xinclude.c
@@ -614,14 +614,15 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) {
}
URL = xmlSaveUri(uri);
xmlFreeURI(uri);
- xmlFree(URI);
if (URL == NULL) {
xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI,
"invalid value URI %s\n", URI);
if (fragment != NULL)
xmlFree(fragment);
+ xmlFree(URI);
return(-1);
}
+ xmlFree(URI);
/*
* If local and xml then we need a fragment
--
2.48.1

View File

@ -7,7 +7,7 @@
Name: libxml2 Name: libxml2
Version: 2.9.7 Version: 2.9.7
Release: 18%{?dist}.1 Release: 18%{?dist}.2
Summary: Library providing XML and HTML support Summary: Library providing XML and HTML support
License: MIT License: MIT
@ -64,6 +64,8 @@ Patch23: libxml2-2.9.7-CVE-2023-29469.patch
Patch24: libxml2-2.11.0-fix-CVE-2023-39615.patch Patch24: libxml2-2.11.0-fix-CVE-2023-39615.patch
# https://issues.redhat.com/browse/RHEL-31056 # https://issues.redhat.com/browse/RHEL-31056
Patch25: libxml2-2.9.7-CVE-2024-25062.patch Patch25: libxml2-2.9.7-CVE-2024-25062.patch
# https://issues.redhat.com/browse/RHEL-76289
Patch26: libxml2-2.9.13-CVE-2022-49043.patch
BuildRequires: gcc BuildRequires: gcc
BuildRequires: cmake-rpm-macros BuildRequires: cmake-rpm-macros
@ -235,6 +237,9 @@ gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz
%{python3_sitearch}/libxml2mod.so %{python3_sitearch}/libxml2mod.so
%changelog %changelog
* Tue Feb 11 2025 David King <dking@redhat.com> - 2.9.7.18.2
- Fix CVE-2022-49043 (RHEL-76289)
* Mon Apr 29 2024 David King <amigadave@amigadave.com> - 2.9.7-18.1 * Mon Apr 29 2024 David King <amigadave@amigadave.com> - 2.9.7-18.1
- Fix CVE-2024-25062 (RHEL-31056) - Fix CVE-2024-25062 (RHEL-31056)