summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/curl/curl/CVE-2014-8150.patch
blob: 9a0828076c2885454c088e853f4daa759cf5c215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 4e2ac2afa94f014a2a015c48c678e2367a63ae82 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Thu, 25 Dec 2014 23:55:03 +0100
Subject: [PATCH] url-parsing: reject CRLFs within URLs

Bug: http://curl.haxx.se/docs/adv_20150108B.html
Reported-by: Andrey Labunets
---
 lib/url.c | 7 +++++++
 1 file changed, 7 insertions(+)

Index: curl-7.37.1/lib/url.c
===================================================================
--- curl-7.37.1.orig/lib/url.c
+++ curl-7.37.1/lib/url.c
@@ -3756,6 +3756,13 @@ static CURLcode parseurlandfillconn(stru
 
   *prot_missing = FALSE;
 
+  /* We might pass the entire URL into the request so we need to make sure
+   * there are no bad characters in there.*/
+  if(strpbrk(data->change.url, "\r\n")) {
+    failf(data, "Illegal characters found in URL");
+    return CURLE_URL_MALFORMAT;
+  }
+
   /*************************************************************
    * Parse the URL.
    *