Control: tags 969529 + patch Control: tags 969529 + pending
Dear maintainer, I've prepared an NMU for libxml2 (versioned as 2.9.10+dfsg-6.2) and uploaded it to DELAYED/5. Please feel free to tell me if I should delay it longer. Additionally to the attached debdiff prepared merge request is at https://salsa.debian.org/xml-sgml-team/libxml2/-/merge_requests/5 Regards, Salvatore
diff -Nru libxml2-2.9.10+dfsg/debian/changelog libxml2-2.9.10+dfsg/debian/changelog --- libxml2-2.9.10+dfsg/debian/changelog 2020-10-14 08:45:25.000000000 +0200 +++ libxml2-2.9.10+dfsg/debian/changelog 2020-10-25 13:56:23.000000000 +0100 @@ -1,3 +1,11 @@ +libxml2 (2.9.10+dfsg-6.2) unstable; urgency=medium + + * Non-maintainer upload. + * Fix out-of-bounds read with 'xmllint --htmlout' (CVE-2020-24977) + (Closes: #969529) + + -- Salvatore Bonaccorso <car...@debian.org> Sun, 25 Oct 2020 13:56:23 +0100 + libxml2 (2.9.10+dfsg-6.1) unstable; urgency=medium * Non-maintainer upload. diff -Nru libxml2-2.9.10+dfsg/debian/patches/Fix-out-of-bounds-read-with-xmllint-htmlout.patch libxml2-2.9.10+dfsg/debian/patches/Fix-out-of-bounds-read-with-xmllint-htmlout.patch --- libxml2-2.9.10+dfsg/debian/patches/Fix-out-of-bounds-read-with-xmllint-htmlout.patch 1970-01-01 01:00:00.000000000 +0100 +++ libxml2-2.9.10+dfsg/debian/patches/Fix-out-of-bounds-read-with-xmllint-htmlout.patch 2020-10-25 13:56:23.000000000 +0100 @@ -0,0 +1,39 @@ +From: Nick Wellnhofer <wellnho...@aevum.de> +Date: Fri, 7 Aug 2020 21:54:27 +0200 +Subject: Fix out-of-bounds read with 'xmllint --htmlout' +Origin: https://gitlab.gnome.org/GNOME/libxml2/-/commit/50f06b3efb638efb0abd95dc62dca05ae67882c2 +Bug: https://gitlab.gnome.org/GNOME/libxml2/-/issues/178 +Bug-Debian: https://bugs.debian.org/969529 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2020-24977 + +Make sure that truncated UTF-8 sequences don't cause an out-of-bounds +array access. + +Thanks to @SuhwanSong and the Agency for Defense Development (ADD) for +the report. + +Fixes #178. +--- + xmllint.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/xmllint.c b/xmllint.c +index f6a8e463639a..c647486f39b4 100644 +--- a/xmllint.c ++++ b/xmllint.c +@@ -528,6 +528,12 @@ static void + xmlHTMLEncodeSend(void) { + char *result; + ++ /* ++ * xmlEncodeEntitiesReentrant assumes valid UTF-8, but the buffer might ++ * end with a truncated UTF-8 sequence. This is a hack to at least avoid ++ * an out-of-bounds read. ++ */ ++ memset(&buffer[sizeof(buffer)-4], 0, 4); + result = (char *) xmlEncodeEntitiesReentrant(NULL, BAD_CAST buffer); + if (result) { + xmlGenericError(xmlGenericErrorContext, "%s", result); +-- +2.28.0 + diff -Nru libxml2-2.9.10+dfsg/debian/patches/series libxml2-2.9.10+dfsg/debian/patches/series --- libxml2-2.9.10+dfsg/debian/patches/series 2020-10-13 09:39:13.000000000 +0200 +++ libxml2-2.9.10+dfsg/debian/patches/series 2020-10-25 13:56:23.000000000 +0100 @@ -4,3 +4,4 @@ Fix-freeing-of-nested-documents.patch python3-unicode-errors.patch parenthesize-type-checks.patch +Fix-out-of-bounds-read-with-xmllint-htmlout.patch