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

CSRF cookie is not working for HTTP #651

Open
misekm opened this issue Aug 25, 2024 · 0 comments
Open

CSRF cookie is not working for HTTP #651

misekm opened this issue Aug 25, 2024 · 0 comments

Comments

@misekm
Copy link

misekm commented Aug 25, 2024

Cookie generated by CSRF middleware is containing attribute 'Secure', which means, that cookie can be transferred only by HTTPS. When using strict http client and using HTTP protocol (unsecured), cookie will not be send in following requests.

It would be good to check incoming request for type of protocol and set 'Secure' attribute based on that.
Potentially event X-Forwarded-For headers.

In production it makes sense to use HTTPS, so this issue will not occur often.
But for example for testing, there is no need for HTTPS at all and in such case this is an issue.

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

No branches or pull requests

1 participant