• Daniel McArdle's avatar
    CreateSanitizedCookie: make IPv6 domain comparison case insensitive · 1921d847
    Daniel McArdle authored
    The canonicalization of file URLs effectively lowercases IPv6
    addresses. This confuses GetCookieDomainWithString; when it determines
    the host is an IP address, it checks whether the specified domain is
    an exact match to the URL's host. This exact string match works fine
    for IPv4 addresses, because lowercasing them has no effect.
    
    Suppose the URL is "file://[A::]" and the domain is "[A::]". Because
    the URL's host was canonicalized as "[a::]", the exact match will
    fail.
    
    The reason the linked Clusterfuzz bug only reproduced on Windows is
    that it relies on Windows-specific behavior that turns URLs that
    resemble UNC paths (prefixed with two backslashes) into file URLs.
    
    Bug: 986675
    Change-Id: I66b81dcd499a36132bdf39e42479425e427f0c4c
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726989Reviewed-by: default avatarMaks Orlovich <morlovich@chromium.org>
    Commit-Queue: Dan McArdle <dmcardle@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#685320}
    1921d847
cookie_util.cc 20.3 KB