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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>11835</bug_id>
          
          <creation_ts>2011-01-21 19:07:56 +0000</creation_ts>
          <short_desc>EventSource must support cross-domain requests (ala CORS)</short_desc>
          <delta_ts>2011-06-18 08:27:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Server-Sent Events (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#top</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>art.barstow</cc>
    
    <cc>glenn</cc>
    
    <cc>ian</cc>
    
    <cc>jackalmage</cc>
    
    <cc>louisremi</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>public-webapps</cc>
    
    <cc>robert</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>44576</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-01-21 19:07:56 +0000</bug_when>
    <thetext>Specification: http://dev.w3.org/html5/eventsource/
Section: http://www.whatwg.org/specs/web-apps/current-work/complete.html#top

Comment:
Please do *not* require a same-origin restriction in user agents (as currently
specified under &quot;Security Considerations&quot;)!  This cross-origin data leakage
security issues have already been addressed by the  CORS specification
(http://www.w3.org/TR/cors/).  EventSource should simply adopt the policies
outlined there.

I consider this a critical flaw, as cross-domain requests are essential to
working around useragent connection limits.  Unless this is addressed,
developers will simply ignore native useragent implementations and write their
own, XHR+CORS-based, APIs (as they&apos;re already doing.)  This spec will be
nothing more than tepid inspiration for those 3rd-party solutions, and ignored
otherwise.

Posted from: 66.220.144.74</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44577</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Kieffer">robert</who>
    <bug_when>2011-01-21 19:14:00 +0000</bug_when>
    <thetext>Currently the EventSource spec imposes a same-origin restriction on user agents.  This is simply not acceptable.

EventSource requires a persistent connection, which conflicts with the per-domain connection limits imposed by user-agents.  The one viable workaround for this issue is to issue persistent requests on a subdomain, which requires the ability to do cross-origin requests.

I&apos;m puzzled why EventSource wouldn&apos;t simply adopt the CORS spec for doing cross-domain requests?  Frankly, that seems so obvious a solution that I feel I must be missing something.... am I?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44578</commentid>
    <comment_count>2</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2011-01-21 19:14:41 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; This cross-origin data leakage
&gt; security issues have already been addressed by the  CORS specification
&gt; (http://www.w3.org/TR/cors/).  EventSource should simply adopt the policies
&gt; outlined there.

I don&apos;t understand how CORS lets us avoid a cross-origin restriction.  CORS is designed to *lift* cross-origin restrictions.  It can only operate if there&apos;s already a restriction in place for it to lift; it doesn&apos;t *create* any new restrictions.  Thus, we either don&apos;t put any restriction, and are stuck with it always being fully open, or we put a cross-origin restriction in, and let CORS selectively relax it when necessary.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44579</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Kieffer">robert</who>
    <bug_when>2011-01-21 23:17:57 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; I don&apos;t understand how CORS lets us avoid a cross-origin restriction.  CORS is
&gt; designed to *lift* cross-origin restrictions.  It can only operate if there&apos;s
&gt; already a restriction in place for it to lift; it doesn&apos;t *create* any new
&gt; restrictions.  Thus, we either don&apos;t put any restriction, and are stuck with it
&gt; always being fully open, or we put a cross-origin restriction in, and let CORS
&gt; selectively relax it when necessary.

Under, &quot;Security Considerations&quot;, the spec currently reads, &quot;user agents are required to block all cross-origin loads.&quot; There is no provision made for using CORS as a way to lift this restriction.  That&apos;s a problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44605</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2011-01-22 11:25:14 +0000</bug_when>
    <thetext>EventSource will get CORS support in due course. CORS is still somewhat experimental at the moment so we are waiting a bit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45657</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-02-16 08:22:36 +0000</bug_when>
    <thetext>Anne is correct in comment 4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49583</commentid>
    <comment_count>6</comment_count>
    <who name="Louis-R">louisremi</who>
    <bug_when>2011-06-14 16:28:09 +0000</bug_when>
    <thetext>We are talking about a specification here, not an implementation. It is a draft, not an experimentation.
Let&apos;s allow CORS in the spec so that implementors can *experiment* with it and provide useful feedback about CORS and how it would play with EventSource.

Waiting for a spec to get more stable before experimenting with it seems illogical to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49719</commentid>
    <comment_count>7</comment_count>
    <who name="Glenn Adams">glenn</who>
    <bug_when>2011-06-16 18:30:34 +0000</bug_when>
    <thetext>I propose to resolve this issue by removing all requirements pertaining to cross-origin uses. As such, this specification defines a mechanism (SSE), but when it starts placing requirements on how this mechanism is used (e.g., in a user agent), it ventures into policy requirements. There is no technical aspect of such policy requirements for which the mechanism itself is technically dependent. Therefore, the policy requirements should be removed from this spec, while continuing to note the relevant security issue. Different uses of the SSE mechanism may wish to employ different policies as well as different techniques to enforce specific policies. As such, this specification should be written in a manner to accommodate all such uses, including a policy that ignores the security issue (because, e.g., other security mechanisms effectively prevent the problem at a higher level).

If HTML5 wishes to normatively employ SSE *and* require CORS or equivalent protection, then the HTML5 specification should be the point at which such requirements are defined.

G.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49828</commentid>
    <comment_count>8</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2011-06-18 08:27:44 +0000</bug_when>
    <thetext>http://html5.org/tools/web-apps-tracker?from=6254&amp;to=6255</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>