cURL libcurl 7.41.0 DoS by a zero-length host name

2015.04.26
Credit: Hanno Böck
Risk: Medium
Local: No
Remote: Yes
CWE: CWE-119


Ogólna skala CVSS: 9/10
Znaczenie: 10/10
Łatwość wykorzystania: 8/10
Wymagany dostęp: Zdalny
Złożoność ataku: Niska
Autoryzacja: Jednorazowa
Wpływ na poufność: Pełny
Wpływ na integralność: Pełny
Wpływ na dostępność: Pełny

VULNERABILITY There is a private function in libcurl called fix_hostname() that removes a trailing dot from the host name if there is one. The function is called after the host name has been extracted from the URL libcurl has been told to act on. If a URL is given with a zero-length host name, like in "http://:80" or just ":80", fix_hostname() will index the host name pointer with a -1 offset (as it blindly assumes a non-zero length) and both read and assign that address. At best, this gets unnoticed but can also lead to a crash or worse. We have not researched further what kind of malicious actions that potentially this could be used for. We are not aware of any exploits of this flaw. INFO This flaw can also be triggered with the curl command line tool. The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2015-3144 to this issue. AFFECTED VERSIONS Affected versions: from libcurl 7.37.0 to and including 7.41.0 Not affected versions: libcurl >= 7.42.0 libcurl is used by many applications, but not always advertised as such! THE SOLUTION libcurl 7.42.0 better verifies the input string to the affected function. A patch for this problem is available at [URL will be updated]: http://curl.haxx.se/CVE-2015-3144.patch From 6218ded6001ea330e589f92b6b2fa12777752b5d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg <daniel@haxx.se> Date: Thu, 16 Apr 2015 23:52:04 +0200 Subject: [PATCH] fix_hostname: zero length host name caused -1 index offset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a URL is given with a zero-length host name, like in "http://:80" or just ":80", `fix_hostname()` will index the host name pointer with a -1 offset (as it blindly assumes a non-zero length) and both read and assign that address. CVE-2015-3144 Bug: http://curl.haxx.se/docs/adv_20150422D.html Reported-by: Hanno Böck --- lib/url.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/url.c b/lib/url.c index ee3d176..f033dbc 100644 --- a/lib/url.c +++ b/lib/url.c @@ -3625,11 +3625,11 @@ static void fix_hostname(struct SessionHandle *data, /* set the name we use to display the host name */ host->dispname = host->name; len = strlen(host->name); - if(host->name[len-1] == '.') + if(len && (host->name[len-1] == '.')) /* strip off a single trailing dot if present, primarily for SNI but there's no use for it */ host->name[len-1]=0; if(!is_ASCII_name(host->name)) { -- 2.1.4 RECOMMENDATIONS We suggest you take one of the following actions immediately, in order of preference: A - Upgrade to curl and libcurl 7.42.0 B - Apply the patch and rebuild libcurl C - Avoid using URLs with zero-length host names! TIME LINE It was first reported to the curl project on April 16 2015. We contacted distros@openwall on April 17th. libcurl 7.42.0 was released on April 22nd 2015, coordinated with the publication of this advisory. CREDITS Reported by Hanno Böck

Referencje:

http://curl.haxx.se/CVE-2015-3144.patch


Vote for this issue:
50%
50%


 

Thanks for you vote!


 

Thanks for you comment!
Your message is in quarantine 48 hours.

Comment it here.


(*) - required fields.  
{{ x.nick }} | Date: {{ x.ux * 1000 | date:'yyyy-MM-dd' }} {{ x.ux * 1000 | date:'HH:mm' }} CET+1
{{ x.comment }}

Copyright 2024, cxsecurity.com

 

Back to Top