#26904: CSRF middleware ignores X-CSRFToken if token not in cookies
-------------------------------+--------------------
     Reporter:  mrmagooey      |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Uncategorized  |    Version:  1.9
     Severity:  Normal         |   Keywords:  csrf
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 This might be desired behaviour, but currently it seems that POST
 `X-CSRFToken` headers are ignored?

 It seems that this line:

 https://github.com/django/django/blob/master/django/middleware/csrf.py#L170

 will set the `csrf_token` to `None` if the token is not available in the
 Cookies header, and then this line:

 https://github.com/django/django/blob/master/django/middleware/csrf.py#L250

 will cause the middleware to return early, and never check the value of
 `X-CSRFToken` header.

 There is a comment around line 250 that this is desired behaviour, so I'm
 a bit confused. My python/django is a little rusty, so apologies if this
 is my bad.

--
Ticket URL: <https://code.djangoproject.com/ticket/26904>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.0afd3af3f4254b2e5688ade6db49bf09%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to