New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 678150 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 627682



Sign in to add a comment

Some non-ascii chars are interpreted as the valid attribute values in http-equiv

Reported by masatoki...@gmail.com, Jan 4 2017

Issue description

VULNERABILITY DETAILS
The following tags work as the `meta refresh` and `meta Set-Cookie` in spite of the http-equiv attribute value has the non-ascii characters:

<meta http-equiv="refreſh" content="0;url=https://attacker/">

<meta http-equiv="ſet-CooKie" content="test=1">


You can test this behavior from:

https://vulnerabledoma.in/char_test?xss=0&charset=utf-8&body=%3Cmeta%20http-equiv=%22refre%C5%BFh%22%20content=%220%3Burl=https://example.com/%22%3E

https://vulnerabledoma.in/char_test?xss=0&charset=utf-8&body=%3Cmeta%20http-equiv=%22%C5%BFet-Coo%E2%84%AAie%22%20content=%22test=1%22%3E%20%3Cbutton%20onclick=alert%28document.cookie%29%3Ealert%28document.cookie%29%3C/button%3E

The non-ascii characters are included as follows:

refre [U+017F] h

[U+017F] et-Coo [U+212A] ie

Due to this behavior, it might break some implementations of the blacklist based sanitizer.
The expected behavior is that Chrome doesn't interpret the non-ascii characters as the valid attribute value in the http-equiv attribute.

Could you confirm this bug?
Thanks!

VERSION
57.0.2970.0(Official Build) canary(64 bit)
 

Comment 1 by mmoroz@google.com, Jan 4 2017

Cc: kouhei@chromium.org csharrison@chromium.org
Components: Blink>HTML>Parser
Labels: Needs-Feedback Pri-2
Thanks for your report.

Regarding expected behavior you've suggested. I'm not sure that you're right here, since your server (vulnerabledoma.in) specifies a charset in Content-Type header:

HTTP/1.1 200 OK
Date: Wed, 04 Jan 2017 11:57:40 GMT
Server: Apache
X-XSS-Protection: 0
X-Other-Header: nothing or invalid
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

<meta http-equiv="refreſh" content="0;url=https://example.com/">


While HTTP standard (https://html.spec.whatwg.org/#character-encoding-declaration) says that ASCII-compatible encoding would be applied:

"If an HTML document does not start with a BOM, and its encoding is not explicitly given by Content-Type metadata, and the document is not an iframe srcdoc document, then the character encoding used must be an ASCII-compatible encoding, and the encoding must be specified using a meta element with a charset attribute or a meta element with an http-equiv attribute in the Encoding declaration state."


To clarify its security implications" what blacklist based sanitizer are you referring to?
>To clarify its security implications" what blacklist based sanitizer are you referring to?
For example, the developers want the users to use many HTML in the their application. But they don't want the attacks such as the XSS. At such time, the blacklist approach is universally used. 

I haven't seen a actual example which is vulnerable by this bug yet. But considering XSS Auditor blocks only meta tags which has the `Set-Cookie` and `Refresh`, basically, if the application blocks only both http-equiv values, we can say almost safe against the attack via meta tags. This bug breaks that premise.

(FYI, Auditor can block both non-ascii variations because it uses the same comparison function named `equalIgnoringCase`.)

Also, the `equalIgnoringCase` function is used many places. I think it has potentially another risks in many places.
Project Member

Comment 4 by sheriffbot@chromium.org, Jan 11 2017

Labels: -Needs-Feedback Needs-Review
Owner: mmoroz@google.com
Thank you for providing more feedback. Adding requester "mmoroz@google.com" for another review and adding "Needs-Review" label for tracking.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 5 by mmoroz@chromium.org, Jan 11 2017

Owner: ----
Cc: tsepez@chromium.org
Components: Blink>SecurityFeature
Labels: -Type-Bug-Security -Restrict-View-SecurityTeam OS-All Type-Bug
Status: Untriaged (was: Unconfirmed)
I'm not sure what the ideal behavior is here. We don't generally treat these kinds of issues as security vulnerabilities for the reasons mentioned at https://dev.chromium.org/Home/chromium-security/security-faq#TOC-Are-XSS-filter-bypasses-considered-security-bugs- (this isn't exactly the same case, but the rationale applies here as well).

I'll leave it up to others to decide what we should do here, though.

Comment 7 by tkent@chromium.org, Jan 13 2017

Components: -Blink>SecurityFeature -Blink>HTML>Parser Blink>HTML
Labels: -Needs-Review Hotlist-GoodFirstBug
Status: Available (was: Untriaged)
Summary: Some non-ascii chars are interpreted as the valid attribute values in http-equiv (was: Security: Some non-ascii chars are interpreted as the valid attribute values in http-equiv)

Comment 8 by tkent@chromium.org, Jan 13 2017

Components: Blink>Network

Comment 9 by tkent@chromium.org, Jan 16 2017

Blocking: 627682
Had chat offline. Note to self.

- We should fix the issue.
-- Using equalIgnoringCase is too loose.
-- I think its safer to have the meta trigger only for restricted ascii set.
- This isn't a *Chromium/Blink* security bug.
-- Per policy: https://dev.chromium.org/Home/chromium-security/security-faq#TOC-Are-XSS-filter-bypasses-considered-security-bugs-
-- Although XSS filter here is more of third-parties.
Components: -Blink>Network Blink>Loader

Comment 12 by l...@chromium.org, Feb 10 2017

Owner: l...@chromium.org
Status: Started (was: Available)

Comment 14 by l...@chromium.org, Mar 19 2017

Status: Fixed (was: Started)
This was fixed.

Sign in to add a comment