#24496: Check CSRF Referer against CSRF_TRUSTED_ORIGINS
------------------------------+------------------------------------
     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:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+------------------------------------

Comment (by joshkehn):

 Right, my question was with `CSRF_TRUSTED_ORIGINS` explicitly set wouldn't
 someone reasonably assume that it's a filter on top of
 `CSRF_COOKIE_DOMAIN`?

 Example: Set `CSRF_COOKIE_DOMAIN` to `.example.com` for convenience of
 configuration so that the cookie is shared among any subdomain. Set
 `CSRF_TRUSTED_ORIGINS` to only allow certain referers to pass the CSRF
 checks.

 My suggestion would be to only use `CSRF_COOKIE_DOMAIN` if
 `CSRF_TRUSTED_ORIGINS` is empty and make that a separate branch of logic.

 Carl, I'm not sure if there's an easy way to split out into a new ticket.
 Do you have one? If not, I can manually do it a bit later today.

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

Reply via email to