1 From 4d729e322fae359a1aefaafec1144764a54e8ad4 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
3 Date: Mon, 6 Mar 2017 10:04:22 +0100
4 Subject: [PATCH] Fix CRLF injection in Wget host part
6 * src/url.c (url_parse): Reject control characters in host part of URL
8 Reported-by: Orange Tsai
9 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
11 Patch status: upstream commit 4d729e322fae35
13 src/url.c | 11 +++++++++++
14 1 file changed, 11 insertions(+)
16 diff --git a/src/url.c b/src/url.c
17 index 8f8ff0b881af..7d36b27d7b92 100644
20 @@ -925,6 +925,17 @@ url_parse (const char *url, int *error, struct iri *iri, bool percent_encode)
21 url_unescape (u->host);
24 + /* check for invalid control characters in host name */
25 + for (p = u->host; *p; p++)
30 + error_code = PE_INVALID_HOST_NAME;
35 /* Apply IDNA regardless of iri->utf8_encode status */
36 if (opt.enable_iri && iri)