CVE-2026-8404
Analyzed Analyzed - Analysis Complete
Cache-Control Bypass in Django via Case-Insensitive Matching

Publication date: 2026-06-03

Last updated on: 2026-06-05

Assigner: Django Software Foundation

Description
An issue was discovered in Django 5.2 before 5.2.15 and 6.0 before 6.0.6. `django.middleware.cache.UpdateCacheMiddleware` in Django does not match `Cache-Control` response directives case-insensitively, which allows remote attackers to read responses that were incorrectly cached because their `Cache-Control` directives used uppercase or mixed-case values. Earlier, unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) were not evaluated and may also be affected. Django would like to thank Ahmed Badawe for reporting this issue.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-06-03
Last Modified
2026-06-05
Generated
2026-06-24
AI Q&A
2026-06-03
EPSS Evaluated
2026-06-22
NVD
EUVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
djangoproject django From 5.2 (inc) to 5.2.15 (exc)
djangoproject django From 6.0 (inc) to 6.0.6 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-178 The product does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Executive Summary

This vulnerability exists in Django versions 5.2 before 5.2.15 and 6.0 before 6.0.6. It involves the django.middleware.cache.UpdateCacheMiddleware component, which does not handle Cache-Control response directives in a case-insensitive manner.

Because of this, if a response's Cache-Control header uses uppercase or mixed-case values, the middleware may incorrectly cache the response. This allows remote attackers to read responses that should not have been cached.

Earlier unsupported Django versions such as 5.0.x, 4.1.x, and 3.2.x may also be affected.

Impact Analysis

The vulnerability can lead to unauthorized disclosure of cached responses because the caching middleware may store and serve sensitive data that should not be cached.

Remote attackers could exploit this flaw to read sensitive information that was incorrectly cached due to case-sensitive handling of Cache-Control headers.

Detection Guidance

This vulnerability involves Django's UpdateCacheMiddleware not matching Cache-Control response directives case-insensitively, which can cause incorrect caching of responses with uppercase or mixed-case Cache-Control headers.

To detect this vulnerability on your system, you can check the Django version in use to see if it is before 5.2.15 or 6.0.6, as these versions are affected.

Additionally, you can inspect HTTP response headers from your Django application to identify Cache-Control directives that use uppercase or mixed-case values, which might be incorrectly cached.

Example commands to help detect this issue include:

  • Check Django version installed: `python -m django --version`
  • Use curl or similar tools to inspect Cache-Control headers in HTTP responses, for example: `curl -I http://your-django-app/endpoint | grep -i Cache-Control`
  • Look for Cache-Control headers with uppercase or mixed-case directives, such as `Cache-Control: MAX-AGE=3600` or `Cache-Control: No-Cache`.

If such headers are present and your Django version is vulnerable, your system may be affected by this issue.

Compliance Impact

The vulnerability in Django's UpdateCacheMiddleware allows remote attackers to read responses that were incorrectly cached due to case-sensitive matching of Cache-Control directives. This could potentially lead to unauthorized disclosure of sensitive information if responses containing personal or protected data are cached and accessible.

Such unauthorized data exposure could impact compliance with data protection regulations like GDPR or HIPAA, which require strict controls over personal and sensitive information to prevent unauthorized access or disclosure.

However, the CVE description and provided resources do not explicitly discuss compliance implications or provide guidance on how this vulnerability affects adherence to these standards.

Mitigation Strategies

To mitigate this vulnerability, you should upgrade Django to a fixed version where the issue is resolved.

  • Upgrade Django 5.2 to version 5.2.15 or later.
  • Upgrade Django 6.0 to version 6.0.6 or later.
  • Consider upgrading earlier unsupported Django series (such as 5.0.x, 4.1.x, and 3.2.x) as they may also be affected.
Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-8404. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart