diff --git a/netwerk/cookie/src/nsCookieService.cpp b/netwerk/cookie/src/nsCookieService.cpp index b10f89147909..e4a19febea39 100644 --- a/netwerk/cookie/src/nsCookieService.cpp +++ b/netwerk/cookie/src/nsCookieService.cpp @@ -1925,6 +1925,13 @@ nsCookieService::CheckDomain(nsCookieAttributes &aCookieAttributes, // no domain specified, use hostFromURI } else { + // block any URIs without a host that aren't file:/// URIs + if (hostFromURI.IsEmpty()) { + PRBool isFileURI = PR_FALSE; + aHostURI->SchemeIs("file", &isFileURI); + if (!isFileURI) + return PR_FALSE; + } aCookieAttributes.host = hostFromURI; }