Closed
Bug 784367
Opened 12 years ago
Closed 12 years ago
Problem on non-ASCII document.cookie & document.write
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
VERIFIED
FIXED
mozilla18
People
(Reporter: masa141421356, Assigned: emk)
References
()
Details
Attachments
(1 file, 2 obsolete files)
5.68 KB,
patch
|
Details | Diff | Splinter Review |
From https://twitter.com/jackmasa/status/236843727086317569
Following code writes '<img src="xx:x" onerror="alert(1)">' to document.
Is this by design or bug ?
<script>
with(document)cookie='∼≩≭≧∯≳≲≣∽≸≸∺≸∠≯≮≥≲≲≯≲∽≡≬≥≲≴∨∱∩∾',write(cookie);
</script>
Reporter | ||
Updated•12 years ago
|
Comment 1•12 years ago
|
||
line 1288 is probably causing all this:
http://dxr.lanedo.com/mozilla-central/content/html/document/src/nsHTMLDocument.cpp.html#l1288
Assignee | ||
Comment 2•12 years ago
|
||
document.cookie must be encoded/decoded as UTF-8 per spec.
http://dev.w3.org/html5/spec/single-page.html#dom-document-cookie
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #654178 -
Flags: review?(bzbarsky)
Comment 4•12 years ago
|
||
Comment on attachment 654178 [details] [diff] [review]
encode/decode document.cookie as UTF-8 per HTML5 spec
r=me, but please add a test or two?
Attachment #654178 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 5•12 years ago
|
||
Ugh, ConvertStringFromCharset("utf-8") also failed if the string is invalid as UTF-8...
> please add a test or two?
Done. one for decoding non-UTF-8 string from HTTP header, and the other for the example in comment #0.
Attachment #654178 -
Attachment is obsolete: true
Attachment #657718 -
Flags: review?(bzbarsky)
Comment 6•12 years ago
|
||
Comment on attachment 657718 [details] [diff] [review]
encode/decode document.cookie as UTF-8 per HTML5 spec
Do we have an existing bug on the missing kOnError_Recover support? If so, please link this code from that bug and add the bug number to the comment. If we don't have one, please file one and then do the above.
r=me
Attachment #657718 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 7•12 years ago
|
||
I found bug 638379.
Assignee | ||
Updated•12 years ago
|
Attachment #657718 -
Attachment is obsolete: true
Assignee | ||
Comment 8•12 years ago
|
||
Keywords: checkin-needed
Comment 9•12 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #8)
> https://tbpl.mozilla.org/?tree=Try&rev=6c0769e869aa
Green on Try.
https://hg.mozilla.org/integration/mozilla-inbound/rev/af0971ca7acd
Comment 10•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Reporter | ||
Comment 11•12 years ago
|
||
-> VERIFIED
Tested at Nightly/Windows build from http://hg.mozilla.org/mozilla-central/rev/0d3b17a88d5f
Status: RESOLVED → VERIFIED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•