#24496: Check CSRF Referer against CSRF_COOKIE_DOMAIN
------------------------------+------------------------------------
     Reporter:  mattrobenolt  |                    Owner:  joshkehn
         Type:  New feature   |                   Status:  assigned
    Component:  CSRF          |                  Version:  master
     Severity:  Normal        |               Resolution:
     Keywords:  csrf          |             Triage Stage:  Accepted
    Has patch:  1             |      Needs documentation:  1
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+------------------------------------
Changes (by carljm):

 * needs_docs:  0 => 1


Old description:

> Right now, if you try to share a CSRF token across a subdomain without
> https, everything works great since the Referer header isn't validated.
>
> But over https, we want to be a bit more strict and make sure that the
> Referer is from another secure site, and also that the Referer matches
> where we think it should be coming from. Django should validate that the
> Referer header matches one of the domains listed in
> `CSRF_TRUSTED_ORIGINS`, including the currently responding
> `ALLOWED_HOST`.

New description:

 Right now, if you try to share a CSRF token across a subdomain without
 https, everything works great since the Referer header isn't validated.

 But over https, we want to be a bit more strict and make sure that the
 Referer is from another secure site, and also that the Referer matches
 where we think it should be coming from. The canonical source for where we
 think it should be from is `CSRF_COOKIE_DOMAIN`.

 If we set our `CSRF_COOKIE_DOMAIN` to `.example.com`, that means our CSRF
 validation should work for `www.example.com` and `foo.example.com`. Not
 just strictly the domain the request is coming from.

--

Comment:

 Resetting the title/summary of this ticket to again be specific to the
 `CSRF_COOKIE_DOMAIN` fix. Also resetting the "needs docs" flag, since I
 think that's all that the original PR for that
 (https://github.com/django/django/pull/4337) is waiting on.

 Sorry again for causing confusion and extra work by mixing these two
 slightly different issues together in one ticket.

--
Ticket URL: <https://code.djangoproject.com/ticket/24496#comment:23>
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/070.e31b92652228a60426160af26a454c34%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to