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

Support for CSRF? #256

Closed
selenwall opened this issue Mar 18, 2016 · 5 comments
Closed

Support for CSRF? #256

selenwall opened this issue Mar 18, 2016 · 5 comments

Comments

@selenwall
Copy link

I don't know if this should go as an issue, but I can't find any documentation on the support for CSRF.

For now, if there aren't such support in whatwg-fetch I would just need to know how I should be able to fetch X-CSRF-TOKEN from the header of OPTIONS request made during CORS preflight. I need this token to use in next request.

@annevk
Copy link
Member

annevk commented Mar 19, 2016

I don't really follow your question. CSRF is not a feature, it's an attack. There's various ways to mitigate that attack, but no particular one is standardized.

@annevk
Copy link
Member

annevk commented Mar 25, 2016

Closing due to lack of follow up.

@annevk annevk closed this as completed Mar 25, 2016
@taodongl
Copy link

taodongl commented Aug 7, 2016

There is the functionality at ajax library https://github.com/mzabriskie/axios:
read token from cookie:XSRF-TOKEN and write the value to http header:X-XSRF-TOKEN
The similar mechanism is used by angular too.

@annevk
Copy link
Member

annevk commented Aug 8, 2016

Okay, libraries can continue to do that on top of fetch(). We're not going to make that part of the standard library however.

@jakearchibald
Copy link
Collaborator

See https://tools.ietf.org/html/draft-west-first-party-cookies-07 for mitigations against csrf

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

No branches or pull requests

4 participants