Issue metadata
Sign in to add a comment
|
Security: %2e in Set-Cookie domain attribute treated as equivalent to "."
Reported by
yakovchu...@kpnu.edu.ua,
May 12 2017
|
||||||||||||||||||||||
Issue descriptionVULNERABILITY DETAILS Hello. I noticed, that the %2e representation of the "." in the Set-Cookie header accepted by browser as valid. Example: Set-Cookie:test=test;domain=%2etest%2ecom considered by Chrome as equals Set-Cookie:test=test;domain=.test.com and lead to the setting cookie to the *.test.com Impact Other browsers: This bug not reproducing in the IE and Firefox. Security impact: this bug can be used with combination of others, for example - CRLF injection (when the WAF filter the "." symbol, bypass with "%2e" is possible in the Google Chrome) VERSION Chrome Version: 58.0.3029.96 + stable Operating System: Windows 7 x64 SP1 REPRODUCTION CASE 1. Configure some test domain test.com with some test content, and create the subdomain subd.test.com with some content 2. Configure the subdomain for setting the cookies with percent-encoded ".": Set-Cookie:test=test;domain=%2etest%2ecom 3. Visit subd.test.com 4. Visit the test.com. The cookies will be present inside the request. Or 1. Find some resource vulnerable to CRLF injection 2. Exploit it using double-encoded "." http[s]://vulnerable.com/%0d%0aSet-Cookie:test=test2;domain=%25%32%65vulnerable%25%32%65com%0d%0a 3. Chrome will accept Set-Cookie header. Other browsers do not.
,
May 12 2017
Repro page: http://debugtheweb.com/test/cookie/domainescaped.aspx
,
May 12 2017
Inside the GetCookieDomainWithString function, // Get the normalized domain specified in cookie line. url::CanonHostInfo ignored; std::string cookie_domain(CanonicalizeHost(domain_string, &ignored)); The CanonicalizeHost function converts the %2e to .
,
May 15 2017
Assigning similar labels as 711505
,
May 16 2017
,
Oct 4
(Unassigning myself, marking untriaged in preparation to retriage with folks who will do a better job taking care of cookies than I've been able to)
,
Oct 12
[mkwst]: I don't suppose you know if we need to support escape sequences in set-cookie domain names in general (for IDNs, especially)? The Set-Cookie spec looks to only support punycoded domain names, but I'm reluctant to trust the spec, if browsers all allow percent-encoding here.
,
Oct 12
Looks like FireFox, at least, doesn't unescape characters in document.cookie=... calls (Testing the Set-Cookie lines of network requests is more involved, and should use the same parser, anyways...), so we'll try following suit.
,
Oct 15
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/31feac996c68b8024000bdad91de45536fd33bcb commit 31feac996c68b8024000bdad91de45536fd33bcb Author: Lily Chen <chlily@chromium.org> Date: Mon Oct 15 15:45:52 2018 Disallow %-escaped characters in cookie domains Previously, any %-escaped characters would be unescaped when parsing a cookie's domain attribute, leading to a potential security vulnerability. This change disallows % characters in the cookie domain by failing to get the cookie domain if the domain string contains a % character. Bug: 721833 Change-Id: Ie55d5228eea33920cfa3792c5bf63989498e769d Reviewed-on: https://chromium-review.googlesource.com/c/1277583 Reviewed-by: Mike West <mkwst@chromium.org> Reviewed-by: Matt Menke <mmenke@chromium.org> Commit-Queue: Lily Chen <chlily@chromium.org> Cr-Commit-Position: refs/heads/master@{#599644} [modify] https://crrev.com/31feac996c68b8024000bdad91de45536fd33bcb/net/cookies/canonical_cookie_unittest.cc [modify] https://crrev.com/31feac996c68b8024000bdad91de45536fd33bcb/net/cookies/cookie_util.cc
,
Oct 15
,
Oct 15
,
Oct 16
,
Oct 22
I'm afraid the VRP panel declined to reward (as is often the case for low severity bugs), but also couldn't detmain how this could be used in an attack. But many thanks for the report, nevertheless!
,
Yesterday
(32 hours ago)
This bug has been closed for more than 14 weeks. Removing security view restrictions. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by elawrence@chromium.org
, May 12 2017