Re: [Django] #34855: Document CSRF_TRUSTED_ORIGINS relation to SECURE_PROXY_SSL_HEADER. (was: Documenting CSRF_TRUSTED_ORIGINS relation to SECURE_PROXY_SSL_HEADER could prevent misconfiguration when proxying HTTPs over HTTP)

2 views
Skip to first unread message

Django

unread,
Sep 21, 2023, 4:26:11 AM9/21/23
to django-...@googlegroups.com
#34855: Document CSRF_TRUSTED_ORIGINS relation to SECURE_PROXY_SSL_HEADER.
-------------------------------------+-------------------------------------
Reporter: jeroenmuller | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 4.2
Severity: Normal | Resolution: wontfix
Keywords: CSRF | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Florian Apolloner (added)
* status: new => closed
* resolution: => wontfix
* easy: 1 => 0


Comment:

Replying to [ticket:34855 jeroenmuller]:
> It might be useful to add a note or warning below
https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-
CSRF_TRUSTED_ORIGINS explaining that it should only be neccessary to
configure this if you are actually making requests across subdomains, and
in other cases setting up SECURE_PROXY_SSL_HEADER might be a more
appropriate solution (as long as the proxy correctly sets a header like X
-Forwarded-Proto).

Using `SECURE_PROXY_SSL_HEADER` must be an informed decision as it may
cause security issues. This is not something we would freely document as a
default solution, especially, since it's only a solution for this
particular setup where you have a trusted proxy that changes the protocol.
I'm skeptical, we cannot document all setting configurations.

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

Reply all
Reply to author
Forward
0 new messages