The vulnerable system is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers). An example of a network attack is an attacker causing a denial of service by sending a specially crafted TCP packet across a wide area network (e.g., CVE-2004-0230).
Attack Complexity
Low
AC
The attacker must take no measurable action to exploit the vulnerability. The attack requires no target-specific circumvention to exploit the vulnerability. An attacker can expect repeatable success against the vulnerable system.
Privileges Required
None
PR
The attacker is unauthenticated prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.
Scope
Unchanged
S
An exploited vulnerability can only affect resources managed by the same security authority. In the case of a vulnerability in a virtualized environment, an exploited vulnerability in one guest instance would not affect neighboring guest instances.
Confidentiality
Low
C
There is some impact on confidentiality, but the attacker either does not gain control of any data, or the information obtained does not have a significant impact on the system or its operations.
Integrity
Low
I
Modification of data is possible, but the attacker does not have control over what can be modified, or the extent of what the attacker can affect is limited. The data modified does not have a direct, serious impact on the system.
Availability
None
A
There is no impact on the availability of the system; the attacker does not have the ability to disrupt access to or use of the system.
Drupal 8.0.x-dev Cross Site ScriptingDOM Based XSS with ` character on IE8 and older versions
IMPORTANT: this issue has been cleared for public discussion and resolution by the Drupal Security Team based on the low evidence of vulnerable browsers still existing.
Problem/Motivation
filter_xss does not filter out the accent grave ` character. This opens up an m-XSS (mutation-XSS) vector in some versions of IE7/8, which treats ` as a delimiter character, and we can escape out of a valid attribute, since it does not put double quotes when it's returned via innerHTML property.
This is rated "Critical" because it's XSS that can easily be triggered by a non-privileged user.
Proof of concept:
<html>
<head>
</head>
<div id="a"><input value="``onmouseover=alert(1)"></div>
<div id="b"></div>
<script>b.innerHTML=a.innerHTML</script>
</html>
Attacker's Input:
``onmouseover=alert(1)
Vulnerable Browsers Output:
<div id="a"><input value=``onmouseover=alert(1)></div>
Patched Browsers Output:
<div id="a"><input value="``onmouseover=alert(1)"></div>
Damien Tournoud was able to find that Drupal cores autocomplete.js is a place where this vulnerability could be exploited, in anything that builds HTML autocomplete snippets (Entity Reference, for example):
$(this.ariaLive).html($(this.selected).html());
This bug was confirmed by grendzy on IE8 version 8.0.7601.17514 (windows 7) in December of 2013. According to Wikipedia, this is the latest stable release of IE8.
However, Pere Orga (June 2015) was unable to reproduce it in IE 8.0.6001.18702 (xp) (though could in IE 7.0.5730.13 (xp)). He was testing with browserstack, which for some reason only offers IE 8.0.6001.19600 on Windows 7 (this version should only be available in XP given the "6001" part of the version number).
Mario Heiderich, the author of http://www.slideshare.net/x00mario/the-innerhtml-apocalypse, claims on slide 28 that a patch is out for IE 8, but this hasnt been able to be confirmed by the Drupal security team.
Proposed resolution
pwolanin notes that the paper at https://cure53.de/fp170.pdf seems to suggest a couple server-side and one client-side fix in section 5. David_Rothstein also noted that "Dealing with it in JavaScript seems like a good backup (maybe for situations where text is filtered without calling filter_xss(), like https://www.drupal.org/project/wysiwyg_filter?). But I think we need to fix it server-side in filter_xss() also."
A client-side fix is available by grendzy. While not a fix for direct calls to .innerHTML, it works by overriding jQuery.html() with a version that replaces ` with "`" for IE 8, and should meet most of core/contribs use cases. Note however that this direction still needs work; it was tested and found not to fix the issue. (It also has a stray console.log() but thats pretty minor.)
A server-side fix is available by pwolanin, based on the HTMLPurifier library. This works by adding a new _filter_xss_ie8_fix_attr_value(&$string) function (called from _filter_xss_attributes()) that triggers IE8 to quote properly in the presence of a ` character. This was tested and found to work.
Remaining tasks
Need someone to test in actual IE 8 / Windows 7 to see if bug has in fact been patched.
get the client-side version working, add tests for the server-side version, back port both to D6.
API changes
Possibly, depending on the route taken. See "Proposed resolution."
Original report by Rafay Baloch
Rafay Baloch posted Dec 2 to security:
While testing your XSS filter function i found that, you are not filtering out the accent grave which has known problems with IE8.
https://api.drupal.org/api/drupal/modules%21filter%21filter.module/funct...
The issue occurs inside of internet explorer only because treats accent grave ` as a delimiter character, and we can escape out of a valid attribute inside of an un-patched IE 8, since it does not put double quotes around our vector when it's returned via innerHTML property.
=============
Proof of concept
=============
Here is the POC that came by slightly modifying the following example at html5sec.org#59.
The POC was tested in Internet explorer version 8:
<html>
<head>
</head>
<div id="a"><input value="``onmouseover=alert(1)"></div>
<div id="b"></div>
<script>b.innerHTML=a.innerHTML</script>
</html>
Attacker's Input:
``onmouseover=alert(1)
Vulnerable Browsers Output:
<div id="a"><input value=``onmouseover=alert(1)></div>
Patched Browsers Output:
<div id="a"><input value="``onmouseover=alert(1)"></div>
When the above POC is tested inside of an unpatched Internet explorer 8, it was noticed that IE 8 does not places quotes around it when it's rendered by innerHTML property. However, When placed in a patched version of internet explorer, it places double quotes around when the string is returned back to the user, hence stopping the attack.
===
Fix
===
Currently, I am not aware of any other solutions then stripping out the accent grave character, encoding doesn't seems to solve the problem here.
==========
References
==========
http://html5sec.org/#59
http://www.slideshare.net/x00mario/the-innerhtml-apocalypse
https://cure53.de/fp170.pdf
--
Warm Regards,
Rafay Baloch
http://rafayhackingarticles.net
http://techlotips.com
This information is provided for TESTING and LEGAL RESEARCH purposes only. All trademarks used are properties of their respective owners. By visiting this website you agree to Terms of Use and Privacy Policy and Impressum