Opened 9 years ago
Last modified 9 years ago
#26419 closed Cleanup/optimization
Description of ALLOWED_HOSTS confusing — at Initial Version
Reported by: | Joshua Pereyda | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.9 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
Problem
The documentation has this to say about the purpose of ALLOWED_HOSTS:
This is a security measure to prevent an attacker from poisoning caches and triggering password reset emails with links to malicious hosts by submitting requests with a fake HTTP Host header, which is possible even under many seemingly-safe web server configurations.
For a newcomer, this can be confusing, as evidenced by:
- The necessity of this StackExchange question: http://security.stackexchange.com/q/45687/5997 and
- The initial answer's resorting to past release notes for more information: http://security.stackexchange.com/a/62313/5997
After further research, I found out that this measure prevents HTTP Host Header attacks; detailed write-ups can be found online. Some people (including myself) find this post confusing, at least in part because:
- The single, long sentence makes it confusing for a newcomer.
- Lack of an attack name makes it hard to learn more.
- Several HTTP Host header attacks are strung together in one description, even though not all Host header attacks involve caches or password reset emails.
Note that the description is also at least partially imprecise (see point 3 above).
Proposed Solution
This is a security measure to prevent HTTP Host header attacks, in which an attacker uses malicious HTTP Host header values to inject code, trigger password reset emails, etc. HTTP Host header attacks can exploit the behavior of web applications, web servers, and web caches, even under many seemingly-safe web server configurations.
Benefits
- Breaks up description into more compact sentences to decrease "wat?" factor.
- Provides name of attack so that users can easily learn more.
- More carefully distinguishes the general purpose (prevent HTTP Host header attacks) from specific examples of target (password reset emails) and vector (poisoning caches).
- Maintains the "even under many seemingly-safe web serve configurations" that will hopefully encourage people to use this feature.