From 9222fc4c05c2c47f13d9405acde6b97159cbd75d Mon Sep 17 00:00:00 2001 From: Tomas Hozza Date: Fri, 12 May 2017 15:41:07 +0200 Subject: [PATCH] Fix CVE-2017-6508 (#1429986) Signed-off-by: Tomas Hozza --- wget-1.19.1-CVE-2017-6508.patch | 37 +++++++++++++++++++++++++++++++++ wget.spec | 8 ++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 wget-1.19.1-CVE-2017-6508.patch diff --git a/wget-1.19.1-CVE-2017-6508.patch b/wget-1.19.1-CVE-2017-6508.patch new file mode 100644 index 0000000..57801e5 --- /dev/null +++ b/wget-1.19.1-CVE-2017-6508.patch @@ -0,0 +1,37 @@ +From 4d729e322fae359a1aefaafec1144764a54e8ad4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tim=20R=C3=BChsen?= +Date: Mon, 6 Mar 2017 10:04:22 +0100 +Subject: [PATCH] Fix CRLF injection in Wget host part + +* src/url.c (url_parse): Reject control characters in host part of URL + +Reported-by: Orange Tsai +--- + src/url.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/url.c b/src/url.c +index 8f8ff0b..7d36b27 100644 +--- a/src/url.c ++++ b/src/url.c +@@ -925,6 +925,17 @@ url_parse (const char *url, int *error, struct iri *iri, bool percent_encode) + url_unescape (u->host); + host_modified = true; + ++ /* check for invalid control characters in host name */ ++ for (p = u->host; *p; p++) ++ { ++ if (c_iscntrl(*p)) ++ { ++ url_free(u); ++ error_code = PE_INVALID_HOST_NAME; ++ goto error; ++ } ++ } ++ + /* Apply IDNA regardless of iri->utf8_encode status */ + if (opt.enable_iri && iri) + { +-- +2.7.4 + diff --git a/wget.spec b/wget.spec index 794ede0..418d5df 100644 --- a/wget.spec +++ b/wget.spec @@ -1,13 +1,15 @@ Summary: A utility for retrieving files using the HTTP or FTP protocols Name: wget Version: 1.19.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: Applications/Internet Url: http://www.gnu.org/software/wget/ Source: ftp://ftp.gnu.org/gnu/wget/wget-%{version}.tar.xz Patch1: wget-1.17-path.patch +# http://git.savannah.gnu.org/cgit/wget.git/commit/?id=4d729e322fae359a1aefaafec1144764a54e8ad4 +patch2: wget-1.19.1-CVE-2017-6508.patch Provides: webclient Provides: bundled(gnulib) @@ -35,6 +37,7 @@ sed -i "s|\(PACKAGE_STRING='wget .*\)'|\1 (Red Hat modified)'|" configure grep "PACKAGE_STRING='wget .* (Red Hat modified)'" configure || exit 1 %patch1 -p1 -b .path +%patch2 -p1 -b .CVE-2017-6508 %build %configure \ @@ -81,6 +84,9 @@ rm -rf $RPM_BUILD_ROOT %{_infodir}/* %changelog +* Fri May 12 2017 Tomas Hozza - 1.19.1-2 +- Fix CVE-2017-6508 (#1429986) + * Thu Feb 16 2017 Tomas Hozza - 1.19.1-1 - New upstream version 1.19.1 (#1421398)