We're looking at implementing server push in mod_spdy now.
The way we do this is to kick off a new Apache request generator that
processes the request for the pushed stream. The pushed stream
inherits request headers from the associated stream.
This mostly works fine however cookies are not scoped in exactly the
same way as the same origin policy (same origin cares only about
scheme hostname port whereas cookies also may care about path) so it's
possible for a valid server push to have different cookies from its
associated stream. For instance imagine I have a cookie A with
hostname www.foo.com and path /foo/bar
Imagine that the associated stream at /foo/bar/baz does a server push
for /other/resource.
In this case it seems that the original cookie A should not be
propagated to the generator/handler for the pushed stream, since its
path does not match. It seems especially undesirable to propagate the
cookie in server environments where /foo/bar/baz and /other/resource
are processed by different systems that aren't supposed to be able to
see each other's cookies.
However I do not think that the server has any knowledge of cookie
scope; the Cookie request header IIRC doesn't include the cookie path,
etc.
So I'm curious how SPDY wants to proceed here. One option would be to
say that pushed streams never inherit cookies, and that the associated
stream is responsible for explicitly specifying all cookies for the
pushed stream at the time the pushed stream is initiated on the
server. This delegates the cookie security scoping problem to the
server, which is the system that does best understand whih cookies are
allowed on which path prefixes. Another would be to say that pushed
streams inherit all cookies of the associated stream (this is the
current wording in the spec as I understand it: "For this reason,
browsers MUST be careful to inherit request headers from the
associated stream for the push. This includes the 'Cookie' header.")
even though we know that if the same stream was initiated by the
client, the cookies might be different due to cookie path scoping.
I am not an HTTP security expert but on first glance I do worry that
we run the risk of leaking cookies outside of their scoped path if we
continue to implement the current policy.
What is the best way to proceed here?
Thanks,
Bryan
--
Thanks,
Jim
http://phython.blogspot.com
Mike, if I'm reading this correctly, you are suggesting that the
spec not specify what to do with cookies, but servers could
implement 3 and/or 4.