This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9225 - lax interpretation of legacy encoding decl allows attackers to change encoding of a page
Summary: lax interpretation of legacy encoding decl allows attackers to change encodin...
Status: CLOSED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: PC All
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard: security
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-11 09:28 UTC by Simon Pieters
Modified: 2010-10-04 14:00 UTC (History)
4 users (show)

See Also:


Attachments

Description Simon Pieters 2010-03-11 09:28:48 UTC
The spec says to look at content='' on each meta and try to interpret it as an encoding decl, even if it doesn't have http-equiv=content-type. This allows attackers to change the encoding if a page allows text to be inserted in a <meta name=description content='...'> (or keywords, author, etc). This can cause scripts to execute twice or change the meaning of URLs and form submission.

Maybe we should require http-equiv=content-type (possibly also other combinations if compat requires e.g. name=content-type or http-equiv=contenttype).

Discussion at http://krijnhoetmer.nl/irc-logs/whatwg/20100311#l-184
Comment 1 contributor 2010-04-12 06:43:56 UTC
Checked in as WHATWG revision r4993.
Check-in comment: Change how character encodings are sniffed to require an http-equiv attribute, and to only process one character encoding per <meta> element, even if attributes are duplicated.
http://html5.org/tools/web-apps-tracker?from=4992&to=4993
Comment 2 contributor 2010-04-12 06:47:43 UTC
Checked in as WHATWG revision r4994.
Check-in comment: Change how <meta> is processed during parsing to require an explicit http-equiv=content-type where applicable.
http://html5.org/tools/web-apps-tracker?from=4993&to=4994
Comment 3 Ian 'Hixie' Hickson 2010-04-12 06:49:09 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diffs given above
Rationale: Concurred with reporter's comments.
Comment 4 Simon Pieters 2010-04-12 07:29:56 UTC
I haven't done a compat study for this yet. But new bugs can be filed if the algorithm needs tweaking.