-
Notifications
You must be signed in to change notification settings - Fork 121
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
Secure csrf #78
Comments
You can drop a hidden element on the page with your created csrf similar to this kraken example Be sure that you have a session to hold onto the secret for validation purposes. Flow:
|
@shaunwarman I use csrf in cookie :) not in html :) |
Ah, ok perfect! What are you trying to change? |
I use node.js in apache (proxy). You can see here https://github.com/krakenjs/lusca/blob/master/lib/csrf.js at line 49 (res.cookie(cookie, token);) I'm forwarding ssl details from apache at node, node knows that site is on https (ssl is set from apache conf)). I set in express-session at cookie section secure= true; I managed to set csrf with security=true only if I overwritten res.cookie (when options.secure true is not set I set automatically to true if https is active) but I don't like this... I don't understand what I omitted.. |
I'm facing the same issue and as I see, there's no way to set the cookie as secure or HTTP only but to overwrite it. This is because the CSRF configuration doesn't accept options for the cookie. |
Opened a pull request with a possible solution: #104 |
how can I set secure csrf?
The text was updated successfully, but these errors were encountered: