Test 61 was modified to verify this.
CVE-2014-3620
Reported-by: Tim Ruehsen
URL: http://curl.haxx.se/docs/adv_20140910B.html
}
else if(Curl_raw_equal("domain", name)) {
bool is_ip;
+ const char *dotp;
/* Now, we make sure that our host is within the given domain,
or the given domain is not valid and thus cannot be set. */
is_ip = isip(domain ? domain : whatptr);
+ /* check for more dots */
+ dotp = strchr(whatptr, '.');
+ if(!dotp)
+ domain=":";
+
if(!domain
|| (is_ip && !strcmp(whatptr, domain))
|| (!is_ip && tailmatch(whatptr, domain))) {
Set-Cookie: test4=no; domain=nope.foo.com; path=/moo; secure\r
Set-Cookie: test5=name; domain=anything.com; path=/ ; secure\r
Set-Cookie: fake=fooledyou; domain=..com; path=/;\r
+Set-Cookie: supercookie=fooledyou; domain=.com; path=/;^M
Content-Length: 4\r
\r
boo