<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Security Analysis Regarding Cross-Site Scripting on Internet Explorer</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Adriana Neago s¸</string-name>
          <email>naie1000@scs.ubbcluj.ro</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>BCI'12, September 16-20, 2012, Novi Sad, Serbia.</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Simona Motogna</string-name>
          <email>motogna@cs.ubbcluj.ro</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Babes ̧ Bolyai University</institution>
          ,
          <addr-line>Kogalniceanu str. 1, Cluj-Napoca</addr-line>
          ,
          <country country="RO">Romania</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Babes ̧ Bolyai University</institution>
          ,
          <addr-line>Kogalniceanu str. 1, Cluj-Napoca</addr-line>
          ,
          <country country="RO">Romania</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Copyright c 2012 by the paper's authors. Copying permitted only for private and</institution>
          ,
          <addr-line>academic purposes. This volume is published and copyrighted by its editors., Local Proceedings also appeared in ISBN 978-86-7031-200-5</addr-line>
          ,
          <institution>Faculty of Sciences, University of Novi Sad.</institution>
        </aff>
      </contrib-group>
      <fpage>125</fpage>
      <lpage>128</lpage>
      <abstract>
        <p>The purpose of this paper is to provide an exact evaluation of cross site scripting vulnerabilities on security, as an important factor of software quality. Since, this kind of risks are dependent on the browser, the study takes into consideration three versions of Internet Explorer, and uses an established scoring system, the Common Vulnerability Scoring System, to measure their impact.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Security</title>
    </sec>
    <sec id="sec-2">
      <title>Cross site scripting, security</title>
      <sec id="sec-2-1">
        <title>1. INTRODUCTION</title>
        <p>Software development focuses on delivering applications
with minimal resources. Architects and developers want to
produce and deploy applications, ready to be executed, in
a short amount of time and only with the strictly
necessary resources (people, software components and hardware).
Software quality is not always set as an important issue, and
tend to be neglected, especially when working against time
or with a limited team. Several studies (NASA, IBM) have
lead to an important conclusion: Improving quality reduces
development costs.</p>
        <p>
          Over the recent years web applications tend to replace
desktop applications, since such an approach makes them
more accessible. In these conditions, software quality factors
are changing their importance, and security becomes an
important factor not only in the evaluation of an application,
but, more importantly, in assuring a reliable operation of the
software. In consequence, a lot of research, both in academia
and industry, focuses on studying risks, vulnerabilities, and
attacks to software security. Open Web Application
Security Project (OWASP) [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] is such an initiative, and
maintains and updates a list of top 10 Security Risks. Cross-Site
Scripting (XSS) is the second as importance, and
considered as having an average exploitability and a high degree
of occurrence. There are a lot of cases in which automatic
tools detect this risk in an easy way, but, however, there are
some situations, generated by new technologies and browser
characteristics, that make detection more difficult.
        </p>
        <p>The purpose of this article is to present an in-depth
analysis of detecting cross-site scripting vulnerabilities and their
impact on software security factor. The rest of the paper
is organized as follows: section 2 presents some of the
existing related work. Section 3 contains an analysis of XSS
vulnerabilities and of the security policies proposed by
different browsers, while the next section is dedicated to our
evaluation of XSS vulnerabilities for Internet Explorer, and
in the end we draw some conclusions and future directions.
2.</p>
      </sec>
      <sec id="sec-2-2">
        <title>RELATED WORK</title>
        <p>
          A lot of research has been carried out in the field of XSS
vulnerabilities. Most of them focuses on studying pattern
attacks, evaluating risks and proposing solutions to prevent
them [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ], [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ], [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ].
        </p>
        <p>
          Security Evaluation and Measurement: Besides the
approaches carried out at major software companies, such
Microsoft, IBM, Apple a.s.o., there are two important
contributions to assesing security vulnerabilities and proposing
metrics to evaluate their impact on software quality:
• Computer Emergency Center (CERT) at Carnegie Melon
University1 with results in risk analysis, based on a tactical
andon a systematic approach, and security measurement,
that are integrated in IMAF (Integrated Measurement and
Analysis Framework) [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ].
• Common Vulnerability Scoring System (CVSS) [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ] that
developed a framework that supports scoring of security
vulnerabilities.
3.
        </p>
      </sec>
      <sec id="sec-2-3">
        <title>ANALYSIS OF CROSS SITE SCRIPTING</title>
      </sec>
      <sec id="sec-2-4">
        <title>VULNERABILITIES</title>
        <p>
          XSS is performed by injection of code (Javascript,
ActiveX, Silverlight, Flash) that is executed by a browser. This
kind of code should be executed under sandboxing
mechanism which means that only a set of operations should be
1www.cert.org
performed, but it is not enough. Michael Howard said that
“All input is evil until proven otherwise. That!s rule
number one” [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ], but in case of XSS not only inputs, but also
outputs must be validated.
        </p>
        <p>There are 3 types of XSS:
• non-persistent or reflected: is performed when there
is no proper validation of user input through GET or
POST requests and the response page is returned
immediately and is spread generally by email via
malicious urls.
• persistent: happens when the infected code is stored in
the database and it is a regular threat to chat software
or application including different posts. User does not
access malicious links, just regular browsing can result
into being robbed of information.
• DOM-based: results from dynamically-computed data,
which means that the browser is manipulated to render
DOM elements controlled by an attacker.</p>
        <p>
          Programming languages provide in-built functions that
perform this kind of filters, but even Microsoft states
regarding their ASP.NET method ValidateRequest that one should
not rely only on this type of validation because unfortunately
it is not 100 percent secure. Recent attacks prove this. Not
only ASP.NET functions have security lacks. Parse url is a
function in PHP that verifies malformed urls. The function
works correctly in most cases except if whitespaces are
inserted. This was the vulnerability exploited on April 2011,
on Facebook, when a malicious video was posted [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] or on
CNN when urls inserted in ad networks were source of this
attack. Other exploits were done also on The New York
Times, on Twiter, e-Bay or on Fox News [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ].
3.1
        </p>
      </sec>
      <sec id="sec-2-5">
        <title>Security Policies</title>
        <p>XSS is the one security field that does not depend on the
type of connection: encrypted or unencrypted, but is closely
related to portability and mainly browser compatibility.
Because it is rendered by different browsers, the display of a
web page can by slightly different, and so its gate of
access. Same origin policy is called the policy adopted against
browser-side languages that does not allow “access to most
methods and properties across pages on different sites”. It is
implemented by nearly each browser, but it does not
guarantee complete security. In addition, modern browsers
implemented several security policies that block an attacker
to gain access on a client machine. Firefox and Opera are
known as relatively secure, but in this paper I would like to
refer to Internet Explorer, which is considered very
vulnerable. A simple example is for instance when uploading text
files through IE: if HTML content is inserted in the file, it
doesn’t treat it as plain text, but it interprets it as HTML.</p>
        <p>
          Internet Explorer 6 introduced HttpOnly cookie attribute
which intended to protect against retrieving information
through document.cookie and Internet Explorer 7 made sure
this information was not available in the response header
through XMLHttpObject. “HttpOnly cookies don’t make
you immune from XSS cookie theft, but they raise the bar
considerably” [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]
        </p>
        <p>
          Starting with Internet Explorer 8, there is introduced a
new very controversial browser filter for XSS. Still, Michael
Brooks describes it as vulnerable and users claim that it also
considers safe pages as potentially dangerous [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. Google
disables it by setting the X-XSS-Protection in the header to
0 or it can be turned off from the browser security tab.
        </p>
        <p>In March 2011, together with the release of version 4,
Firefox proposed the adoption of a new layer to enforce XSS
protection called the Content Security Policy. This framework
is still not implemented yet on other browsers, but Microsoft
claims that it will be a feature of Internet Explorer 10.</p>
        <p>
          Runtime protection methods should also be taken into
consideration, even if they affect the performance of the
application. Web application firewalls(WAF’s) monitor the
communication flow across the network and therefore they
inspect messages for Javascript and can enforce a set of
rules in order identify and block XSS attacks that would
not reach no more the backend. Example of such
applications are Cisco ACE Web Application Firewall [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ], NetScaler
App Firewall [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] or Barracuda Web Application Firewall [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ].
Most WAF’s implement the Intercepting Filter pattern or
include one or more implementations in their overall
architecture. One can also add filters to an application at
deployment when implemented as a Web server plug-in or when
activated dynamically within an application configuration
file.
        </p>
        <p>
          Moreover, Microsoft offers an Anti-Cross Site Scripting
Library [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] and OWASP advises programmers to use an API:
ESAPI (The OWASP Enterprise Security API) [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] which is
an open source web application security control library.
        </p>
        <p>Users should be also educated to avoid XSS exploits.
Avoiding awkward links, paying attention to redirections or for
instance turning off the HTTP TRACE can prevent the
stealing of cookies.</p>
        <p>Regardless the variety of prevention methods new exploits
continue to attack web applications and it’s our duty to keep
on protection against the known or unknown security flaws.
4.</p>
      </sec>
      <sec id="sec-2-6">
        <title>CVSS SCORES FOR XSS VULNERABIL</title>
      </sec>
      <sec id="sec-2-7">
        <title>ITIES</title>
        <p>
          Our case study consists in computing the CVSS
vulnerability scores for some XSS related vulnerabilities
reported by Microsoft. CVSS or the Common Vulnerability
Scoring System is an open framework that provides a
numerical score by taking into consideration base, temporal
or environmental properties of a certain vulnerability.
The computatiopn is performed according to the
formula given in [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ] and using the calculator available at
http://nvd.nist.gov/cvss.cfm?calculator&amp;adv&amp;version=2.
Each of the three metric groups has its own characteristics
and contains a set of metrics. Base metric group describes
the fundamental characteristics of a vulnerability and is
composed of the related exploit range, the attack
complexity, the needed authentication level and the integrity,
availability and confidentiality impact. Temporal are the
metrics influenced by time passing, meaning the availability
of exploit, the remediation level and the report of
confidence. Environment has also an impact when computing
the score; environmental factors are the collateral damage
potential, the target distribution and the confidentiality,
integrity and availability requirement.
        </p>
        <p>When talking about XSS exploits some of these metrics
remain constant because of the type of this vulnerability.
The related exploit range or the access vector is the network,
because the attack is widely spread over the internet and
the access complexity is medium. The majority of reports
written by Microsoft describe vulnerabilities on Internet
Explorer having the standard, default configurations, but it is
medium and not low, because the attacker is required to
have some social engineering skills in order manipulate and
fool custom users to access a certain page or click a
specific button or link. In order to be considered successful,
the attack has to gain information or control over the client
machine and for this at least one instance of authentication
is needed. The availability impact metric refers to the
access of the attacker over the resources, meaning bandwidth,
processor, disk space and his possibility to get a total
shutdown of the affected resource. In case of an XSS exploit, we
consider this availability impact to be none; it is
impossible from what we know until now for someone to access the
resources using this type of vulnerability. We have
intentionally skipped the confidentiality and integrity impact because
they vary depending on the attack and we are focused now
on the constant metrics of XSS exploits.</p>
        <p>Moving to the temporal group, we will argue the
chosen values to the metrics based on the vulnerabilities
reported by Microsoft on their periodical security bulletins.
We let the exploitability factor set to not defined, because
officially they say that the exploitation code was not made
public: “Microsoft received information about this
vulnerability through coordinated vulnerability disclosure.”,
“Microsoft had not received any information to indicate that
this vulnerability had been publicly used to attack customers
when this security bulletin was originally issued”. Moreover,
all the vulnerabilities are confirmed and are reported only
after an official fix is available.</p>
        <p>The damage potential of an XSS vulnerability is according
to OWASP moderate. We are not talking about a physical
damage, but there can be significant loss of information.</p>
        <p>Last, but not least there are the impact requirement
modifiers. As any browser, Internet Explorer is meant to be
secure. Confidentiality, integrity and availability are the three
features users require for safe browsing and financial
transactions.</p>
        <p>The metrics that change depending on the XSS exploit are
the confidentiality and integrity impact and the percentage
of vulnerable systems. In order to see how these metrics
differ we will consider three vulnerabilities URL Validation
Vulnerability2, HTML Layout Remote Code Execution
Vulnerability and XSS Filter Information Disclosure
Vulnerability. URL Validation Vulnerability is a critical
vulnerability reported in February 2010 that appeared from
incorrectly validated input. It provided the attacker access to
the client machine with the same rights as the logged in
user and if the attacker could reach administrative rights,
he could install programs, read or change data. In this case,
because remote code could be executed, the confidentiality
and integrity impact is complete. Regarding the target
distribution, which was Internet Explorer, it was reported as
a vulnerability on IE 7 and 8 which at that time covered
72.8% of the market, so medium spread. The score in this
case reaches 6.3. On August 2011, another vulnerability was
reported, XSS Filter Information Disclosure Vulnerability3.
It was performed by running malicious Javascript code in
specially constructed web pages. It was reported as
important, because it provided information disclosure and it was
applicable only on IE 8, meaning 52% of the users having
Internet Explorer. We reach a lower score 5.5 as the
attacker could gain only access to information and not remote
control and the confidentiality and integrity impact is
partial. HTML Layout Remote Code Execution Vulnerability4
is a more complex vulnerability, affecting IE 7, 8, 9 (94%
of the market). It is related to the way Internet Explorer
handles objects in memory and has a complete impact on
integrity and confidentiality. In this special case, the access
complexity is increased and the score reaches 7.7. Target
distribution on Internet Explorer is calculated related to the
date of the report taking into consideration data provided by
http://www.w3schools.com/browsers/browsers explorer.asp
The table from Figure 1 displays the resulting scores.</p>
        <p>The first important remark is that vulnerability risks
regarding HTML Layout Remote Code Execution and URL
Validation Vulnerability remain the same in all three
releases of Internet Explorer under study. HTML Layout
Remote Code Execution has a slightly higher risk than URL
Validation Vulnerability.</p>
        <p>The second observation is that the security policies adopted
by Internet Explorer cannot face sophisticated attacks such
as HTML Layout Remote Code Execution, in which case a
CVSS score of 7.7 is quite high.</p>
        <p>The security policies introduced in IE 8 can decrease the
vulnerability score of information disclosure through the XSS
Filter.</p>
        <p>Yet there is no announced vulnerability on Internet
Explorer 10 which is available in platform preview.</p>
        <p>
          These results can contribute to the evaluation of the
business impact of XSS vulnerabilities. The browser-dependent
risks must be carefully treated since they allow attackers to
have end user privileges and to gain control of the
applications. The computed scores confirm the OWASP evaluation,
and the position of cross site scripting vulnerabilities on their
list [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
5.
        </p>
      </sec>
      <sec id="sec-2-8">
        <title>CONCLUSIONS AND FUTURE WORK</title>
        <p>The paper gives an overview of XSS vulnerabilities from a
browser point of view. We study the impact of HTML
Layout Remote Code Execution, URL Validation Vulnerability
and XSS Filter Information Disclosure for three releases of
Internet Explorer (7,8,9). We have used the CVSS
vulnerability scoring formula in order to measure the impact of these
vulnerabilities on security. The obtained results confirm the
OWASP analysis, for exploitability and impact.
http://technet.microsoft.com/en-us/security/bulletin/MS12-010</p>
        <p>In our opinion, XSS vulnerabilities should be carefully
treated, and eliminated them can improve significantly the
security of the application.</p>
        <p>As future direction of our study, we intend to study other
forms of XSS vulnerabilities, that are difficult to detect with
dedicated tools, such the ones due to using ActiveX and
Silverlight.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Security</surname>
          </string-name>
          ,
          <string-name>
            <surname>Anti-Cross Site</surname>
          </string-name>
          Scripting Library, http://msdn.microsoft.com/en-us/security/aa973814
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Jeff</given-names>
            <surname>Atwood</surname>
          </string-name>
          , Coding horror,
          <source>Protecting Your Cookies: HttpOnly, August</source>
          <volume>28</volume>
          ,
          <year>2008</year>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Barracuda</given-names>
            <surname>Networks</surname>
          </string-name>
          , http://www.barracudanetworks.com/ns/products/web
          <article-title>-sitefirewall-overview</article-title>
          .php
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Brooks</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <article-title>Bypassing Internet Explorer's XSS Filter</article-title>
          , Traps Of Gold-Defcon
          <year>2011</year>
          , https://sitewat.ch/files/BypassingInternetExplorer'sXSSFilter.pdf
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Cisco</given-names>
            <surname>ACE Web Application</surname>
          </string-name>
          <string-name>
            <surname>Firewall</surname>
          </string-name>
          , http://www.cisco.com/en/US/prod/collateral/contnetw/- ps5719/ps9586/data sheet c78-
          <fpage>458627</fpage>
          .html
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Citrix</given-names>
            <surname>NetScaler App Firewall</surname>
          </string-name>
          http://www.citrix.com/English/ps2/products/product.asp?- contentID=
          <fpage>2312027</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Open</given-names>
            <surname>Web Application Security Project</surname>
          </string-name>
          , www.owasp.org
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Measuring</given-names>
            <surname>Software Security Assurance</surname>
          </string-name>
          , www.cert.org/archive/pdf/2010research-reportmeasuring.pdf
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>P.</given-names>
            <surname>Mell</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Scarfone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Romanosky</surname>
          </string-name>
          ,
          <string-name>
            <surname>A Complete</surname>
          </string-name>
          <article-title>Guide to the Common Vulnerability Scoring System Version 2</article-title>
          .0, http://www.first.org/cvss/cvss-guide.pdf
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Klein</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          (
          <year>2005</year>
          ).
          <article-title>DOM Based Cross Site Scripting or XSS of the Third Kind</article-title>
          .
          <source>Web Application Security Consortium Articles</source>
          ,
          <volume>4</volume>
          . Retrieved from http://www.webappsec.org/projects/articles/071105.shtml
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Wassermann</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <article-title>Static detection of cross-site scripting vulnerabilities</article-title>
          ,
          <source>Proc. of ICSE</source>
          <year>2008</year>
          , pg.
          <fpage>171</fpage>
          -
          <lpage>180</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>Di</given-names>
            <surname>Lucca</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.A.</given-names>
            ,
            <surname>Fasolino</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.R.</given-names>
            ,
            <surname>Mastoianni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Tramontana</surname>
          </string-name>
          ,
          <string-name>
            <surname>P.</surname>
          </string-name>
          ,
          <article-title>Identifying cross site scripting vulnerabilities in Web applications</article-title>
          ,
          <source>Proc. WSE</source>
          <year>2004</year>
          , pg.
          <fpage>71</fpage>
          -
          <lpage>80</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Howard</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>LeBlanc D.</surname>
          </string-name>
          , Writing Secure Code, Microsoft Press,
          <year>2003</year>
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Social</surname>
            <given-names>Hacking</given-names>
          </string-name>
          ,
          <source>Recent Facebook XSS Atacks Show Incresing Sophistication, April</source>
          <volume>21</volume>
          ,
          <year>2011</year>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>Lynch</surname>
            <given-names>D.</given-names>
          </string-name>
          , XSS is fun!,
          <source>October</source>
          <volume>20</volume>
          ,
          <year>2011</year>
          , http://davidlynch.org/blog/2011/10/xss-is-fun/
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>