#26094: CSRF fails behind proxy
----------------------------+--------------------
     Reporter:  chemary     |      Owner:  nobody
         Type:  Bug         |     Status:  new
    Component:  CSRF        |    Version:  1.9
     Severity:  Normal      |   Keywords:  csrf
 Triage Stage:  Unreviewed  |  Has patch:  1
Easy pickings:  1           |      UI/UX:  0
----------------------------+--------------------
 I use gunicorn behind nginx and a load balancer, CSRF fails since 1.9 (the
 code was introduced here
 
https://github.com/django/django/commit/b0c56b895fd2694d7f5d4595bdbbc41916607f45)

 The problem is that if settings.CSRF_COOKIE_DOMAIN is defined it uses
 request.META['SERVER_PORT'] to check that the port is the same and fails
 behind a proxy.

 Using request method get_port() takes is into account and I find that is
 more correct that useing the header directly.

 Patch is on:
 
https://github.com/chemary/django/commit/081685242dac206783024e1834d1f178b5b8b9b9

--
Ticket URL: <https://code.djangoproject.com/ticket/26094>
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/050.0e2f6e36211d4c6c0888a5347f2ccfb2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to