| Summary: | "Allow from current website only" privacy setting strips cookies from 302 redirects | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Patrick Toomey <ptoomey3> |
| Component: | Platform | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | ap, jberlin, jjulian, sam |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Mac | ||
| OS: | OS X 10.10 | ||
|
Description
Patrick Toomey
2014-12-16 10:54:03 PST
In order to work around this issue for our users we changed all our OAuth redirects to use a meta refresh instead of performing a 302 redirect. This generally works, but there are scenarios where it is not ideal. For example, we found one scenario where a page embedded something like the following `<img src="https://some_oauth_app/generate_some_image?width=50&length=50">` The above is a reference to an OAuth app that will perform the OAuth dance with GitHub.com if the user doesn't currently have an active session. Unfortunately, it looks like subresource requests like this will not follow meta refresh based redirects. So, the only way to not break these uses is to use a 302 redirect. But, that brings us back to the original issue described above. This seems to be an issue a number of people have encountered: https://github.com/intridea/omniauth-oauth2/issues/72 https://github.com/zotonic/zotonic/issues/902 People seem to generally be working around it using this meta refresh approach. This Safari behavior seems to break OAuth in a fundamental way. OAuth applications are required to prevent CSRF during the OAuth dance by passing a `state` value. This value is generally tracked in the originating site's session. However, by stripping cookies on the final redirect the originating site has no session with which to validate `state`. Thank you for the reminder! This turned out to be an issue below WebKit, which should be fixed in El Capitan public beta. Closing as INVALID since it was not a WebKit bug. That is great news! Can you clarify one point? When I first submitted this radar I only noticed the cookie stripping on a 302 redirect during the oauth flow. But, I recently noticed that the cookie stripping seems to occur on any third-party request. For example, if I set an image source to https://some_site/authenticated_image it also doesn't send previously set cookies. Will this upcoming fix work with subresources in addition to 302 redirects? I encourage you to test with the public beta. I would encourage you to test with a public beta to see if it works. |