... ich are generated from the HTTP Host header. Some attacks against this are beyond Django's ability to control, and require the web server to be properly config ... documentation has for some time contained notes advising users on such configuration. Django's own built-in parsing of the Host header is, however, still vulnerable, as was reported to us recently. The Host header parsing in Django 1.3.3 and Django 1 ... .4.1 -- specifically, django.http.HttpRequest.get_host() -- was incorrectly handling username/password information in the header. Thus, for example, the following Host header wo ... ... name, which are generated from the HTTP Host header. Some attacks against this are beyond Django's ability to control, and require the web server to be properly config ... documentation has for some time contained notes advising users on such configuration. Django's own built-in parsing of the Host header is, however, still vulnerable, as was reported to us recently. The Host header parsing in Django 1.3.3 and Django 1 ... .4.1 -- specifically, django.http.HttpRequest.get_host() -- was incorrectly handling username/password information in the header. Thus, for example, the following Host header wo ... ... 6.1 で非推奨: The following settings and functions will be removed in Django 2028: EMAIL_BACKEND , EMAIL_FILE_PATH , EMAIL_HOST , EMAIL_HOST_PASSWORD , EMAIL_HOST_USER , EMAIL_PORT , EMAIL_SSL_CERTFILE , EMAIL_SSL_KEYFILE , EMAIL_TIMEOUT , EMAIL_USE_ ... s ... , }, }, } For example, to update these settings: EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" EMAIL_HOST = "mail.example.net" EMAIL_USE_TLS = True EMAIL_PORT = 587 EMAIL_HOST_USER = "user@example.net" EMAIL_HOST_PASSWORD = "pas ... sword" use: MAILERS = { "default" : { "BACKEND" : "django.core.mail.backends.smtp.EmailBackend" , "OPTIONS" : { "host" : "mail.example.net" , "use_tls" : True , # port is not needed: it defaults to 587 with use_tls True. "username" : "user@ ... ... endent of end-user-written applications -- make use of full URLs, including domain name, which are generated from the HTTP Host header. Django's documentation has for some time contained notes advising users on how to configure web servers to ensure ... that only valid Host headers can reach the Django application. However, it has been reported to us that even with the recommended web server co ... ues available for tricking many common web servers into supplying the application with an incorrect and possibly malicious Host header. For this reason, Django 1.3.6 adds a new setting, ALLOWED_HOSTS , which should contain an explicit list of valid h ... ... curity release in the Django 1.4 series. Host header poisoning Some parts of Django -- independent of end-user-written applications -- make use of full URLs, including ... domain name, which are generated from the HTTP Host header. Django's documentation has for some time contained notes advising users on how to configure web servers to ensure ... that only valid Host headers can reach the Django application. However, it has been reported to us that even with the recommended web server co ... ... ap each Address in str(...) . Changed in Django 6.0: In older versions, required a list of (name, address) tuples. ALLOWED_HOSTS デフォルト値: [] (空のリスト) Django サイトを配信できるホスト/ドメイン名を表す文字列のリストです。これはセキュリティ対策の ... 手段の1つで、一見安全な設定の Web サーバでも晒される可能性が高い、 HTTP Host header 攻撃 を防ぐことができます。 このリスト中の値は完全修飾名 (fully qualified names) (例: 'www.example.com' ) でも大丈夫 ... です。その場合には、リクエストの Host ヘッダに完全一致するかチェックされます (ポートを含まない、大文字小文字を無視した比較になります)。ピリオドで始まる値は、サブ ... ... urther steps to tighten up Django's code in response to independent discovery of potential problems from multiple sources. Host header poisoning Several earlier Django security releases focused on the issue of poisoning the HTTP Host header, causing ... r input received and reports of continuing issues following the previous release, we're taking additional steps to tighten Host header validation. Rather than attempt to accommodate all features HTTP supports here, Django's Host header validation att ... empts to support a smaller, but far more common, subset: Hostnames must consist of characters [A-Za-z0-9] plus hyphen ('-') or dot ('.'). IP addresses -- both IPv4 and IPv6 -- are perm ... ... urther steps to tighten up Django's code in response to independent discovery of potential problems from multiple sources. Host header poisoning Several earlier Django security releases focused on the issue of poisoning the HTTP Host header, causing ... r input received and reports of continuing issues following the previous release, we're taking additional steps to tighten Host header validation. Rather than attempt to accommodate all features HTTP supports here, Django's Host header validation att ... empts to support a smaller, but far more common, subset: Hostnames must consist of characters [A-Za-z0-9] plus hyphen ('-') or dot ('.'). IP addresses -- both IPv4 and IPv6 -- are perm ... ... E_HSTS_SECONDS 、 SECURE_HSTS_INCLUDE_SUBDOMAINS , と SECURE_HSTS_PRELOAD 、もしくはウェブサーバ上のどれかで設定されます。 Host ヘッダーの検証 Django uses the Host header provided by the client to construct URLs in certain cases. While these values a ... re sanitized to prevent cross-site scripting attacks, a fake Host value can be used for cross-site request forgery, cache poisoning attacks, and poisoning links in emails. Because even see ... mingly-secure web server configurations are susceptible to fake Host headers, Django validates Host headers against the ALLOWED_HOSTS setting in the django.http.HttpRequest.get_host() method. ... ... on the local machine: MAILERS = { "default" : { "BACKEND" : "django.core.mail.backends.smtp.EmailBackend" , "OPTIONS" : { "host" : "localhost" , }, }, } Django abstracts the email sending process into an "email backend" class. メールのバックエンド li ... ches. Changed in Django 6.1: In earlier releases, Django defaulted to sending email through an SMTP server running on localhost, using the now-deprecated EMAIL_BACKEND and related settings. バージョン 6.1 で非推奨: Until Django 2028, if the MAILERS s ... etting is not defined then the earlier behavior still applies: Django will default to using an SMTP server on localhost (but will issue deprecation warnings). Starting in Django 2028, attempts to send email without MAILERS defined will result ... 2026年10月08日