Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSP: form-action and redirects #482

Closed
ptoomey3 opened this issue Sep 23, 2015 · 2 comments
Closed

CSP: form-action and redirects #482

ptoomey3 opened this issue Sep 23, 2015 · 2 comments
Labels
Milestone

Comments

@ptoomey3
Copy link

I just wanted to open an issue to get your thoughts on form-action with respect to redirects. We have been working on deploying form-action and have run into a few scenarios that all boil down to:

  • Perform some action by doing a POST to self
  • Based on request params/backend state, redirect the user to another site

One big use case of this is OAuth, where we have users submit a form to authorize access to their account. After the POST we redirect the user back to the OAuth application to complete the OAuth dance.

However, for these kinds of scenarios to work with form-action we would either have to:

  • Determine where we plan to redirect the user for each OAuth authorization so that we can add an appropriate value for form-action.
  • Use something like meta refresh to redirect the user after authorizing (since this doesn't count as a form submit)

I can see why one might want to limit method preserving redirection with a 307, but I couldn't think of much risk with allowing 302 style redirects. I guess there is some value in avoiding the redirection, though it feels somewhat orthogonal to the immediate risk associated with accidentally submitting form contents to an untrusted site. Anyway, I was just curious what your thoughts were on the topic.

/cc @mastahyeti @gregose @oreoshake

@mikewest mikewest added the CSP label Sep 28, 2015
@mikewest mikewest added this to the CSP 3 milestone Sep 28, 2015
@mikewest
Copy link
Member

Hrm. I think it would be inconsistent with the rest of CSP to differentiate between types of redirection, but you're right to suggest that the risk of a 302 vs 307 is substantially lower for the specific case that form-action is meant to deal with. Certainly something worth talking about for CSP3.

Setting label and milestone appropriately.

@mikewest
Copy link
Member

mikewest commented Oct 7, 2015

This issue was moved to w3c/webappsec-csp#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants