Name of CSRF cookie is hard-coded.
See original GitHub issueHey folks,
I’ve run into a problem with CSRF while using Dash with Django. The gist of it is that the route handler in our setup used for processing the _dash-update-component
call requires CSRF (not something we can turn off). This is all fine, however, api.js
in dash-renderer
hardcodes the name of the cookie to read the token from
'X-CSRFToken': cookie.parse(document.cookie)._csrf_token
This means that we have to either change our cookie names across the project, or simply not use dash. I’d rather use it cause it’s a great product, but I can’t change our cookie name across the board.
Would it be possible to make this value configurable?
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top Results From Across the Web
CSRF tokens | Web Security Academy - PortSwigger
A CSRF token is a unique, secret, unpredictable value that is generated by the server-side application and transmitted to the client in such...
Read more >CSRF and Cross-Origin Requests by Example
In this article, we will go over how a basic CSRF (cross-site request forgery) attack works and how a CSRF token prevents this...
Read more >Add CSRF token to hard coded Django form - Stack Overflow
For this view, I removed the CSRF token verification using the @csrf_exempt decorator. To avoid abuse, I added a Google Recaptcha verification.
Read more >Things to keep in mind concerning CSRF attacks - Eclipse Vert.x
As a result, the server that hosts the target parent domain now sees two cookies with the same name but cannot distinguish which...
Read more >Guide to CSRF (Cross-Site Request Forgery) - Veracode
CSRF attacks require that the user is authenticated against the targeted site with some form of persistent cookie or credentials.
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 Free
Top 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
I believe that we aren’t actually using this token anymore, as we removed CSRF protection in https://github.com/plotly/dash/pull/146. This logic wasn’t removed in the dash front-end, and so I believe we are safe to remove it.
We’re merging
dash-renderer
into thedash
repo. Moving this issue to thedash
repo in case anyone is interested in following up. As mentioned we’d happily accept a PR to make the cookie and header configurable.