... s two complementary headers: Content-Security-Policy : Enforces the CSP policy, blocking content that violates the defined directives. Content-Security-Policy-Report-Only : Reports CSP violations without blocking content, allowing for non-intrusive testing ... . Each policy is composed of one or more directives and their values, which together instruct the browser on how to handle specific types of content. When the ContentSecurity ... immediate feedback during development. To also receive these reports programmatically, the policy must include a reporting directive such as report-uri that specifies where violation data should be sent. Django supports configuring these directives via the ... ... cording to the Django security policy . CVE-2026-8404: Potential exposure of private data via case-sensitive Cache-Control directives UpdateCacheMiddleware and cache_page() incorrectly cached responses marked with private Cache-Control directives when usin ... (e.g. Private ). The cache_control() decorator and patch_cache_control() function were not affected, since they normalize directives to lowercase. This issue only affects responses where Cache-Control is set manually. This issue has severity "low" accordi ... ... cording to the Django security policy . CVE-2026-8404: Potential exposure of private data via case-sensitive Cache-Control directives UpdateCacheMiddleware and cache_page() incorrectly cached responses marked with private Cache-Control directives when usin ... (e.g. Private ). The cache_control() decorator and patch_cache_control() function were not affected, since they normalize directives to lowercase. This issue only affects responses where Cache-Control is set manually. This issue has severity "low" accordi ... ... two: from django.utils.csp import CSP # To enforce a CSP policy: SECURE_CSP = { "default-src" : [ CSP . SELF ], # Add more directives to be enforced. } # Or for report-only mode: SECURE_CSP_REPORT_ONLY = { "default-src" : [ CSP . SELF ], # Add more directi ... config, you need to: Include the NONCE placeholder value in the CSP settings. This only applies to script-src or style-src directives: from django.utils.csp import CSP SECURE_CSP = { "default-src" : [ CSP . SELF ], # Allow self-hosted scripts and script ta ... ... リシー (Cross-Origin Opener Policy) ヘッダを設定します。 SECURE_CSP New in Django 6.0. Default: {} This setting defines the directives used by the ContentSecurityPolicyMiddleware , which generates and adds a Content-Security-Policy (CSP) header to all respo ... The setting must be a mapping (typically a dictionary) of directive names to their values. Each key should be a valid CSP directive such as default-src or script-src . The corresponding value can be a list, tuple, or set of source expressions or URLs to a ... rc" : [ CSP . SELF ], "img-src" : [ "data:" , CSP . SELF , "https://images.example.com" ], "frame-src" : [ CSP . NONE ], } Directives validation Django's CSP middleware helps construct and send the appropriate header based on your settings, but it does not ... ... d debugging. For configuration instructions, see the Using CSP documentation, and refer to the CSP overview for details on directives and settings. Limitations and considerations While CSP is a powerful security mechanism, it's important to understand its ... onments, measure the performance impact accordingly. Browser support: While CSP Levels 1 and 2 are widely supported, newer directives (CSP Level 3+) or complex policy behaviors may vary across browsers. Test your policy across the environments you intend t ... ... er. For example, use :cve:`2019-14232` . When documenting Python objects (classes, methods, attributes, etc.) using Sphinx directives such as .. class:: , .. method:: , and .. attribute:: , all content must be properly indented to ensure correct rendering ... ext under the directive must be indented by 4 spaces. Multi-line descriptions must keep the same indentation level. Nested directives (for example, methods inside a class) require an additional 4 spaces of indentation to maintain hierarchy. Field lists (su ... ... LayersWidget ) and the OpenStreetMap tile servers must be allowed: from django.utils.csp import CSP SECURE_CSP = { # other directives "img-src" : [ CSP . SELF , "https://tile.openstreetmap.org" ], } Changed in Django 6.0: The OSMWidget no longer uses a cus ... ... patch) Django 5.2 (patch) June 3, 2026 - CVE 2026-8404 Potential exposure of private data via case-sensitive Cache-Control directives in UpdateCacheMiddleware . Full description Django 6.1 (patch) Django 6.0 (patch) Django 5.2 (patch) June 3, 2026 - CVE 20 ... 2026年10月08日