<?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>144817</bug_id>
          
          <creation_ts>2015-05-08 15:58:55 -0700</creation_ts>
          <short_desc>Origin HTTP header not set to null after following cross-origin redirect</short_desc>
          <delta_ts>2015-05-11 12:29:58 -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>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>144157</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=98838</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=112471</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brad Hill">hillbrad</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1093328</commentid>
    <comment_count>0</comment_count>
    <who name="Brad Hill">hillbrad</who>
    <bug_when>2015-05-08 15:58:55 -0700</bug_when>
    <thetext>The HTTP Origin header, described by https://tools.ietf.org/html/rfc6454, allows a server to determine a user agent&apos;s view of where a request originated from.

RFC6454 allows this header to be multi-valued on redirects, but CORS (http://w3.org/TR/cors) implicitly requires it to be single-valued (because it specifies an exact string match comparison).
All major user agents implement single-valued behavior, and because of this must set the header to &apos;null&apos; when a redirect crosses same-origin boundaries.  If the value of the original Origin is preserved after a 3xx redirect, it may result in a confused deputy vulnerability that allows bypass of CSRF protections.

For example, the issue described at the following post is enabled by this incorrect behavior:

http://sakurity.com/blog/2015/03/05/RECONNECT.html

Test cases are available at the following URLs:

https://www.webappsec-test.info/~bhill2/OriginRedir/test.php?redircode=302
https://www.webappsec-test.info/~bhill2/OriginRedir/test.php?redircode=303
https://www.webappsec-test.info/~bhill2/OriginRedir/test.php?redircode=307
https://www.webappsec-test.info/~bhill2/OriginRedir/test.php?redircode=308

WebKit is vulnerable by not setting Origin to null on cross-origin redirects on any 3xx status code which preserves the GET/POST payload.

A similar issue was reported to Blink for status code 308, and has since been patched, see:

https://code.google.com/p/chromium/issues/detail?id=465517</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1093659</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-05-10 23:03:48 -0700</bug_when>
    <thetext>&lt;rdar://problem/20893169&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1093850</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2015-05-11 12:29:58 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 144157 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>