|
|
|
|
|
by gojomo
4986 days ago
|
|
Not exactly, but sort of. My estimation of what would be most safe/robust would be for a deployment to know its own canonical hostname/base-URL, and use that trusted value in construction of emailed URLs. Perhaps this would be one of the explicit parameters that vary in dev-vs-production configurations. Maybe it's looked up from a key that's the local hostname. Perhaps, even, it's looked up based on the 'Host' header, but if the key is absent it's a failure. (Then, the available mappings are a sort of whitelist.) The official Django recommendation essentially equates to, "be sure to enforce a whitelist on passed 'Host' values at the HTTP server". So it's leaving responsibility to the many alternate web server configurations Django devs might be using... while it could be solved definitively with a slightly different practice inside Django itself. |
|
On the other hand, you're completely right that the "you gotta get your upstream server configured correctly" advice is handwavy at best.
Seems like this is always the case, this tension between security and usability...
If you've got bright ideas, I'd love to hear 'em. Maybe join us on django-dev (http://groups.google.com/group/django-developers) if you do?