diff options
| author | Anuj Mittal <anuj.mittal@intel.com> | 2019-07-25 12:02:59 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-10-08 22:52:28 +0100 |
| commit | d59f2b0a74f6d114466f9b94395c59cf1bb2f7ca (patch) | |
| tree | 0ca2b0b511b3d26406ad52953b01884b2e0cf827 | |
| parent | 94ac57739c90e7f77c333de87b6c9f33cf227dcb (diff) | |
| download | poky-d59f2b0a74f6d114466f9b94395c59cf1bb2f7ca.tar.gz | |
libxslt: fix CVE-2019-13117 CVE-2019-13118
(From OE-Core rev: 7dc3048fec88dd62ef49ef16517b7382ab7cf2a5)
(From OE-Core rev: 07cd0d606fea63e683c7de7ebfaa6a55170b8318)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
[Fixup for thud context]
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-support/libxslt/files/CVE-2019-13117.patch | 33 | ||||
| -rw-r--r-- | meta/recipes-support/libxslt/files/CVE-2019-13118.patch | 76 | ||||
| -rw-r--r-- | meta/recipes-support/libxslt/libxslt_1.1.32.bb | 4 |
3 files changed, 112 insertions, 1 deletions
diff --git a/meta/recipes-support/libxslt/files/CVE-2019-13117.patch b/meta/recipes-support/libxslt/files/CVE-2019-13117.patch new file mode 100644 index 0000000000..ef3f2709f7 --- /dev/null +++ b/meta/recipes-support/libxslt/files/CVE-2019-13117.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | From c5eb6cf3aba0af048596106ed839b4ae17ecbcb1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Nick Wellnhofer <wellnhofer@aevum.de> | ||
| 3 | Date: Sat, 27 Apr 2019 11:19:48 +0200 | ||
| 4 | Subject: [PATCH] Fix uninitialized read of xsl:number token | ||
| 5 | |||
| 6 | Found by OSS-Fuzz. | ||
| 7 | |||
| 8 | CVE: CVE-2019-13117 | ||
| 9 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxslt/commit/c5eb6cf3aba0af048596106ed839b4ae17ecbcb1] | ||
| 10 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
| 11 | --- | ||
| 12 | libxslt/numbers.c | 5 ++++- | ||
| 13 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/libxslt/numbers.c b/libxslt/numbers.c | ||
| 16 | index 89e1f668..75c31eba 100644 | ||
| 17 | --- a/libxslt/numbers.c | ||
| 18 | +++ b/libxslt/numbers.c | ||
| 19 | @@ -382,7 +382,10 @@ xsltNumberFormatTokenize(const xmlChar *format, | ||
| 20 | tokens->tokens[tokens->nTokens].token = val - 1; | ||
| 21 | ix += len; | ||
| 22 | val = xmlStringCurrentChar(NULL, format+ix, &len); | ||
| 23 | - } | ||
| 24 | + } else { | ||
| 25 | + tokens->tokens[tokens->nTokens].token = (xmlChar)'0'; | ||
| 26 | + tokens->tokens[tokens->nTokens].width = 1; | ||
| 27 | + } | ||
| 28 | } else if ( (val == (xmlChar)'A') || | ||
| 29 | (val == (xmlChar)'a') || | ||
| 30 | (val == (xmlChar)'I') || | ||
| 31 | -- | ||
| 32 | 2.21.0 | ||
| 33 | |||
diff --git a/meta/recipes-support/libxslt/files/CVE-2019-13118.patch b/meta/recipes-support/libxslt/files/CVE-2019-13118.patch new file mode 100644 index 0000000000..595e6c2f33 --- /dev/null +++ b/meta/recipes-support/libxslt/files/CVE-2019-13118.patch | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | From 6ce8de69330783977dd14f6569419489875fb71b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Nick Wellnhofer <wellnhofer@aevum.de> | ||
| 3 | Date: Mon, 3 Jun 2019 13:14:45 +0200 | ||
| 4 | Subject: [PATCH] Fix uninitialized read with UTF-8 grouping chars | ||
| 5 | |||
| 6 | The character type in xsltFormatNumberConversion was too narrow and | ||
| 7 | an invalid character/length combination could be passed to | ||
| 8 | xsltNumberFormatDecimal, resulting in an uninitialized read. | ||
| 9 | |||
| 10 | Found by OSS-Fuzz. | ||
| 11 | |||
| 12 | CVE: CVE-2019-13118 | ||
| 13 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxslt/commit/6ce8de69330783977dd14f6569419489875fb71b] | ||
| 14 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
| 15 | |||
| 16 | --- | ||
| 17 | libxslt/numbers.c | 5 +++-- | ||
| 18 | tests/docs/bug-222.xml | 1 + | ||
| 19 | tests/general/bug-222.out | 2 ++ | ||
| 20 | tests/general/bug-222.xsl | 6 ++++++ | ||
| 21 | 4 files changed, 12 insertions(+), 2 deletions(-) | ||
| 22 | create mode 100644 tests/docs/bug-222.xml | ||
| 23 | create mode 100644 tests/general/bug-222.out | ||
| 24 | create mode 100644 tests/general/bug-222.xsl | ||
| 25 | |||
| 26 | diff --git a/libxslt/numbers.c b/libxslt/numbers.c | ||
| 27 | index f1ed8846..20b99d5a 100644 | ||
| 28 | --- a/libxslt/numbers.c | ||
| 29 | +++ b/libxslt/numbers.c | ||
| 30 | @@ -1298,13 +1298,14 @@ OUTPUT_NUMBER: | ||
| 31 | number = floor((scale * number + 0.5)) / scale; | ||
| 32 | if ((self->grouping != NULL) && | ||
| 33 | (self->grouping[0] != 0)) { | ||
| 34 | + int gchar; | ||
| 35 | |||
| 36 | len = xmlStrlen(self->grouping); | ||
| 37 | - pchar = xsltGetUTF8Char(self->grouping, &len); | ||
| 38 | + gchar = xsltGetUTF8Char(self->grouping, &len); | ||
| 39 | xsltNumberFormatDecimal(buffer, floor(number), self->zeroDigit[0], | ||
| 40 | format_info.integer_digits, | ||
| 41 | format_info.group, | ||
| 42 | - pchar, len); | ||
| 43 | + gchar, len); | ||
| 44 | } else | ||
| 45 | xsltNumberFormatDecimal(buffer, floor(number), self->zeroDigit[0], | ||
| 46 | format_info.integer_digits, | ||
| 47 | diff --git a/tests/docs/bug-222.xml b/tests/docs/bug-222.xml | ||
| 48 | new file mode 100644 | ||
| 49 | index 00000000..69d62f2c | ||
| 50 | --- /dev/null | ||
| 51 | +++ b/tests/docs/bug-222.xml | ||
| 52 | @@ -0,0 +1 @@ | ||
| 53 | +<doc/> | ||
| 54 | diff --git a/tests/general/bug-222.out b/tests/general/bug-222.out | ||
| 55 | new file mode 100644 | ||
| 56 | index 00000000..e3139698 | ||
| 57 | --- /dev/null | ||
| 58 | +++ b/tests/general/bug-222.out | ||
| 59 | @@ -0,0 +1,2 @@ | ||
| 60 | +<?xml version="1.0"?> | ||
| 61 | +1⠢0 | ||
| 62 | diff --git a/tests/general/bug-222.xsl b/tests/general/bug-222.xsl | ||
| 63 | new file mode 100644 | ||
| 64 | index 00000000..e32dc473 | ||
| 65 | --- /dev/null | ||
| 66 | +++ b/tests/general/bug-222.xsl | ||
| 67 | @@ -0,0 +1,6 @@ | ||
| 68 | +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | ||
| 69 | + <xsl:decimal-format name="f" grouping-separator="⠢"/> | ||
| 70 | + <xsl:template match="/"> | ||
| 71 | + <xsl:value-of select="format-number(10,'#⠢0','f')"/> | ||
| 72 | + </xsl:template> | ||
| 73 | +</xsl:stylesheet> | ||
| 74 | -- | ||
| 75 | 2.21.0 | ||
| 76 | |||
diff --git a/meta/recipes-support/libxslt/libxslt_1.1.32.bb b/meta/recipes-support/libxslt/libxslt_1.1.32.bb index df3f97aa12..e2a515f857 100644 --- a/meta/recipes-support/libxslt/libxslt_1.1.32.bb +++ b/meta/recipes-support/libxslt/libxslt_1.1.32.bb | |||
| @@ -11,7 +11,9 @@ DEPENDS = "libxml2" | |||
| 11 | SRC_URI = "http://xmlsoft.org/sources/libxslt-${PV}.tar.gz \ | 11 | SRC_URI = "http://xmlsoft.org/sources/libxslt-${PV}.tar.gz \ |
| 12 | file://fix-rvts-handling.patch \ | 12 | file://fix-rvts-handling.patch \ |
| 13 | file://CVE-2019-11068.patch \ | 13 | file://CVE-2019-11068.patch \ |
| 14 | " | 14 | file://CVE-2019-13117.patch \ |
| 15 | file://CVE-2019-13118.patch \ | ||
| 16 | " | ||
| 15 | 17 | ||
| 16 | SRC_URI[md5sum] = "1fc72f98e98bf4443f1651165f3aa146" | 18 | SRC_URI[md5sum] = "1fc72f98e98bf4443f1651165f3aa146" |
| 17 | SRC_URI[sha256sum] = "526ecd0abaf4a7789041622c3950c0e7f2c4c8835471515fd77eec684a355460" | 19 | SRC_URI[sha256sum] = "526ecd0abaf4a7789041622c3950c0e7f2c4c8835471515fd77eec684a355460" |
