question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Name of CSRF cookie is hard-coded.

See original GitHub issue

Hey 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:open
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
chriddypcommented, Jan 18, 2018

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.

0reactions
alexcjohnsoncommented, May 22, 2019

We’re merging dash-renderer into the dash repo. Moving this issue to the dash repo in case anyone is interested in following up. As mentioned we’d happily accept a PR to make the cookie and header configurable.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found