Skip to content

Commit 81fb40a

Browse files
[AUTO-CHERRYPICK] libxml2: address CVE-2024-40896 - branch 3.0-dev (#11720)
Co-authored-by: Muhammad Falak R Wani <[email protected]>
1 parent ae7f8ab commit 81fb40a

File tree

6 files changed

+54
-13
lines changed

6 files changed

+54
-13
lines changed

SPECS/libxml2/CVE-2024-40896.patch

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From ae8f0ac0a2900219c3d762ae0b513e199dcf19a5 Mon Sep 17 00:00:00 2001
2+
From: Nick Wellnhofer <[email protected]>
3+
Date: Sat, 6 Jul 2024 01:03:46 +0200
4+
Subject: [PATCH] [CVE-2024-40896] Fix XXE protection in downstream code
5+
6+
Some users set an entity's children manually in the getEntity SAX
7+
callback to restrict entity expansion. This stopped working after
8+
renaming the "checked" member of xmlEntity, making at least one
9+
downstream project and its dependants susceptible to XXE attacks.
10+
11+
See #761.
12+
---
13+
parser.c | 8 ++++++++
14+
1 file changed, 8 insertions(+)
15+
16+
diff --git a/parser.c b/parser.c
17+
index 4feb21a28..8fe0a064d 100644
18+
--- a/parser.c
19+
+++ b/parser.c
20+
@@ -7148,6 +7148,14 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
21+
return;
22+
}
23+
24+
+ /*
25+
+ * Some users try to parse entities on their own and used to set
26+
+ * the renamed "checked" member. Fix the flags to cover this
27+
+ * case.
28+
+ */
29+
+ if (((ent->flags & XML_ENT_PARSED) == 0) && (ent->children != NULL))
30+
+ ent->flags |= XML_ENT_PARSED;
31+
+
32+
/*
33+
* The first reference to the entity trigger a parsing phase
34+
* where the ent->children is filled with the result from
35+
--
36+
GitLab
37+

SPECS/libxml2/libxml2.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
Summary: Libxml2
22
Name: libxml2
33
Version: 2.11.5
4-
Release: 1%{?dist}
4+
Release: 2%{?dist}
55
License: MIT
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
88
Group: System Environment/General Libraries
99
URL: https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home
1010
Source0: https://gitlab.gnome.org/GNOME/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.gz
11+
Patch0: CVE-2024-40896.patch
1112
BuildRequires: python3-devel
1213
BuildRequires: python3-xml
1314
Provides: %{name}-tools = %{version}-%{release}
@@ -78,6 +79,9 @@ find %{buildroot} -type f -name "*.la" -delete -print
7879
%{_libdir}/cmake/libxml2/libxml2-config.cmake
7980

8081
%changelog
82+
* Thu Dec 26 2024 Muhammad Falak <[email protected]> - 2.11.5-2
83+
- Patch CVE-2024-40896
84+
8185
* Tue Nov 21 2023 CBL-Mariner Servicing Account <[email protected]> - 2.11.5-1
8286
- Auto-upgrade to 2.11.5 - Azure Linux 3.0 - package upgrades
8387

toolkit/resources/manifests/package/pkggen_core_aarch64.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ curl-8.8.0-3.azl3.aarch64.rpm
199199
curl-devel-8.8.0-3.azl3.aarch64.rpm
200200
curl-libs-8.8.0-3.azl3.aarch64.rpm
201201
createrepo_c-1.0.3-1.azl3.aarch64.rpm
202-
libxml2-2.11.5-1.azl3.aarch64.rpm
203-
libxml2-devel-2.11.5-1.azl3.aarch64.rpm
202+
libxml2-2.11.5-2.azl3.aarch64.rpm
203+
libxml2-devel-2.11.5-2.azl3.aarch64.rpm
204204
docbook-dtd-xml-4.5-11.azl3.noarch.rpm
205205
docbook-style-xsl-1.79.1-14.azl3.noarch.rpm
206206
libsepol-3.6-1.azl3.aarch64.rpm

toolkit/resources/manifests/package/pkggen_core_x86_64.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ curl-8.8.0-3.azl3.x86_64.rpm
199199
curl-devel-8.8.0-3.azl3.x86_64.rpm
200200
curl-libs-8.8.0-3.azl3.x86_64.rpm
201201
createrepo_c-1.0.3-1.azl3.x86_64.rpm
202-
libxml2-2.11.5-1.azl3.x86_64.rpm
203-
libxml2-devel-2.11.5-1.azl3.x86_64.rpm
202+
libxml2-2.11.5-2.azl3.x86_64.rpm
203+
libxml2-devel-2.11.5-2.azl3.x86_64.rpm
204204
docbook-dtd-xml-4.5-11.azl3.noarch.rpm
205205
docbook-style-xsl-1.79.1-14.azl3.noarch.rpm
206206
libsepol-3.6-1.azl3.x86_64.rpm

toolkit/resources/manifests/package/toolchain_aarch64.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ libtool-debuginfo-2.4.7-1.azl3.aarch64.rpm
240240
libxcrypt-4.4.36-2.azl3.aarch64.rpm
241241
libxcrypt-debuginfo-4.4.36-2.azl3.aarch64.rpm
242242
libxcrypt-devel-4.4.36-2.azl3.aarch64.rpm
243-
libxml2-2.11.5-1.azl3.aarch64.rpm
244-
libxml2-debuginfo-2.11.5-1.azl3.aarch64.rpm
245-
libxml2-devel-2.11.5-1.azl3.aarch64.rpm
243+
libxml2-2.11.5-2.azl3.aarch64.rpm
244+
libxml2-debuginfo-2.11.5-2.azl3.aarch64.rpm
245+
libxml2-devel-2.11.5-2.azl3.aarch64.rpm
246246
libxslt-1.1.39-1.azl3.aarch64.rpm
247247
libxslt-debuginfo-1.1.39-1.azl3.aarch64.rpm
248248
libxslt-devel-1.1.39-1.azl3.aarch64.rpm
@@ -541,7 +541,7 @@ python3-gpg-1.23.2-2.azl3.aarch64.rpm
541541
python3-jinja2-3.1.2-1.azl3.noarch.rpm
542542
python3-libcap-ng-0.8.4-1.azl3.aarch64.rpm
543543
python3-libs-3.12.3-5.azl3.aarch64.rpm
544-
python3-libxml2-2.11.5-1.azl3.aarch64.rpm
544+
python3-libxml2-2.11.5-2.azl3.aarch64.rpm
545545
python3-lxml-4.9.3-1.azl3.aarch64.rpm
546546
python3-magic-5.45-1.azl3.noarch.rpm
547547
python3-markupsafe-2.1.3-1.azl3.aarch64.rpm

toolkit/resources/manifests/package/toolchain_x86_64.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ libtasn1-debuginfo-4.19.0-1.azl3.x86_64.rpm
245245
libtasn1-devel-4.19.0-1.azl3.x86_64.rpm
246246
libtool-2.4.7-1.azl3.x86_64.rpm
247247
libtool-debuginfo-2.4.7-1.azl3.x86_64.rpm
248-
libxml2-2.11.5-1.azl3.x86_64.rpm
249-
libxml2-debuginfo-2.11.5-1.azl3.x86_64.rpm
250-
libxml2-devel-2.11.5-1.azl3.x86_64.rpm
248+
libxml2-2.11.5-2.azl3.x86_64.rpm
249+
libxml2-debuginfo-2.11.5-2.azl3.x86_64.rpm
250+
libxml2-devel-2.11.5-2.azl3.x86_64.rpm
251251
libxcrypt-4.4.36-2.azl3.x86_64.rpm
252252
libxcrypt-debuginfo-4.4.36-2.azl3.x86_64.rpm
253253
libxcrypt-devel-4.4.36-2.azl3.x86_64.rpm
@@ -549,7 +549,7 @@ python3-gpg-1.23.2-2.azl3.x86_64.rpm
549549
python3-jinja2-3.1.2-1.azl3.noarch.rpm
550550
python3-libcap-ng-0.8.4-1.azl3.x86_64.rpm
551551
python3-libs-3.12.3-5.azl3.x86_64.rpm
552-
python3-libxml2-2.11.5-1.azl3.x86_64.rpm
552+
python3-libxml2-2.11.5-2.azl3.x86_64.rpm
553553
python3-lxml-4.9.3-1.azl3.x86_64.rpm
554554
python3-magic-5.45-1.azl3.noarch.rpm
555555
python3-markupsafe-2.1.3-1.azl3.x86_64.rpm

0 commit comments

Comments
 (0)