Seems like `context.csrf` is being set without me doing anything
See original GitHub issueI am debugging my project and have a breakpoint set at this line: https://github.com/koajs/csrf/blob/master/src/index.js#L56
Now when I evaluate (ctx.csrf), I get a value back. However I am not sending a CSRF token anywhere in my application…all I’ve done is set Koa to use the CSRF middleare…I haven’t embedded _csrf
in a hidden form field anywhere, nor have I appended a csrf token to any of my requests. So my question is, how is ctx.csrf
already set?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
django admin login suddenly demanding csrf token
This error was appearing for me when I had not set CSRF_COOKIE_DOMAIN in my settings_local but it was set in my main settings.py....
Read more >What is CSRF (Cross-site request forgery)? Tutorial & Examples
Cross-site request forgery (also known as CSRF) is a web security vulnerability that allows an attacker to induce users to perform actions that...
Read more >How to avoid getting "csrf failed"? · Issue #817 · oauth2-proxy ...
I can reproduce this 100% of the time, by clearing all data in Chrome, and then attempting to login. It will result in...
Read more >19. Cross Site Request Forgery (CSRF) - Spring
The issue is that the HTTP request from the bank's website and the request from the evil website are exactly the same. This...
Read more >Preventing CSRF Attacks with the SameSite Cookie Attribute
This article explains how the Samesite web cookie attribute works and how it can be used to prevent cross-site request forgery (CSRF) attacks....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, the token is set whether or not you send it. This library asserts that the token was provided by the user.
It’s clear that a “real” example is necessary here. I’ll see if I can throw something together in shortly.
The token is valid for the duration of the user’s session in SPAs and for each request otherwise. Basically any time we can create a new token, we will.