Able to create cookie with empty name and empty name/value
Reported by
opma...@gmail.com,
May 14 2017
|
||||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36 Steps to reproduce the problem: 1. Able to set cookie with empty name. By doing this in console document.cookie = "chromiumbugs.appspot.com;", it is setting cookie with empty name and value as "chromiumbugs.appspot.com. See attachment (chrome_cookie_noname.png) 2. Able to set cookie with empty name and empty value. By doing this in console document.cookie = ";", it is setting cookie with empty name and empty value. See attachment (chrome_cookie_noname_novalue.png) What is the expected behavior? Chrome shouldn't allow cookie with empty name as it is not as per RFC. http://tools.ietf.org/html/rfc6265#section-4.2.1 What went wrong? Empty cookie are causing issue in parsing in application layer as this is not as per RFC. Did this work before? N/A Chrome version: 58.0.3029.96 Channel: n/a OS Version: 10.0 Flash Version: Shockwave Flash 25.0 r0
,
May 16 2017
Tested the issue in Win-10 using chrome stable version #58.0.3029.110. Attached a screen cast for reference. Following are the steps followed to reproduce the issue. ------------ 1. Opened chrome browser. 2. Opened dev tools and pasted document.cookie = "chromiumbugs.appspot.com; in the console. 3. Got an uncaught syntax error. opmaity@ - Could you please provide a test file to test the issue. This will help us in triaging the issue further Thanks...!!
,
May 17 2017
This looks more appropriate for the Cookie team.
,
May 17 2017
Hi @krajshree, You need to go a domain before calling document.cookie = ..... Please see the screen cast.
,
May 30 2017
,
Apr 18 2018
[+morlovich]: Mind seeing what other browsers do here?
,
Apr 25 2018
,
Apr 26 2018
Support for nameless cookies is intentional (there is specifically code to not send =whatever), and I don't know how close that RFC is to reality --- Firefox ESR 52 seems to behave identically, at least. The no-name, no value thing is weird, though. It's not observable on the wire, but it does seem to be in the database.
,
Apr 26 2018
Edge seems to largely agree with us and Firefox; but interestingly Safari is different. If you do document.cookie = "Foo"; it interprets Foo as a name, not value, and actually sends Foo= in the Cookie header; so this isn't 100% interoperable right now. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by ranjitkan@chromium.org
, May 15 2017