gnu: expat: fix CVE-2018-20843

* gnu/packages/xml.scm (expat)[replacement]: New field.
(expat/fixed): New variable.
* gnu/packages/patches/expat-CVE-2018-20843.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add patch file.

Signed-off-by: Marius Bakke <mbakke@fastmail.com>
master
Jack Hill 2019-07-10 16:23:03 -04:00 committed by Marius Bakke
parent f85c8dd8ae
commit 5a836ce38c
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
3 changed files with 31 additions and 0 deletions

View File

@ -784,6 +784,7 @@ dist_patch_DATA = \
%D%/packages/patches/evilwm-lost-focus-bug.patch \
%D%/packages/patches/exiv2-CVE-2017-14860.patch \
%D%/packages/patches/exiv2-CVE-2017-14859-14862-14864.patch \
%D%/packages/patches/expat-CVE-2018-20843.patch \
%D%/packages/patches/extundelete-e2fsprogs-1.44.patch \
%D%/packages/patches/fastcap-mulGlobal.patch \
%D%/packages/patches/fastcap-mulSetup.patch \

View File

@ -0,0 +1,21 @@
Fix extraction of namespace prefix from XML name.
Fixes CVE-2018-20843
This patch comes from upstream commit 11f8838bf99ea0a6f0b76f9760c43704d00c4ff6
https://github.com/libexpat/libexpat/commit/11f8838bf99ea0a6f0b76f9760c43704d00c4ff6
CVE is https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-20843
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
index 30d55c5..737d7cd 100644
--- a/lib/xmlparse.c
+++ b/lib/xmlparse.c
@@ -6071,7 +6071,7 @@ setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType)
else
poolDiscard(&dtd->pool);
elementType->prefix = prefix;
-
+ break;
}
}
return 1;

View File

@ -66,6 +66,7 @@
(define-public expat
(package
(name "expat")
(replacement expat/fixed)
(version "2.2.6")
(source (let ((dot->underscore (lambda (c) (if (char=? #\. c) #\_ c))))
(origin
@ -88,6 +89,14 @@ stream-oriented parser in which an application registers handlers for
things the parser might find in the XML document (like start tags).")
(license license:expat)))
(define expat/fixed
(package
(inherit expat)
(source
(origin
(inherit (package-source expat))
(patches (search-patches "expat-CVE-2018-20843.patch"))))))
(define-public libebml
(package
(name "libebml")