LOW 3.1

CVE-2026-48588: Django Cache Middleware Data Leakage Vulnerability

Django's caching middleware can inadvertently store and serve responses to users who shouldn't have access to them. Specifically, when a web application uses Django's built-in cache features, the system may cache sensitive data tied to one user's session and then deliver it to another user if they send requests with different cookies. This happens because the cache doesn't properly distinguish between requests based on unrelated cookie values. An attacker would need to craft requests to trigger the cache to serve cached private data, making this a read-only exposure rather than an active attack vector.

Source data · NVD / CISA · public domain

CVSS
3.1 · 3.1 LOW · CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N
Weaknesses (CWE)
CWE-524
Affected products
1 configuration(s)
Published / Modified
2026-07-07 / 2026-07-09

NVD description (verbatim)

An issue was discovered in Django 6.0 before 6.0.7 and 5.2 before 5.2.16. `UpdateCacheMiddleware` and the `cache_page()` decorator cache responses that vary on cookies when the incoming request carries unrelated cookies, which allows remote attackers to read private data from the shared cache. 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 Chris Whyland for reporting this issue.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-48588 affects Django's `UpdateCacheMiddleware` and `cache_page()` decorator in versions 6.0 before 6.0.7 and 5.2 before 5.2.16. The vulnerability stems from improper cache key generation when requests carry cookies. The middleware caches HTTP responses that should vary based on cookie values, but fails to account for the presence of unrelated cookies in the request. This violates cache coherency assumptions and allows an attacker to retrieve cached responses intended for other users. The issue is classified under CWE-524 (Unprotected Transport of Credentials), reflecting the potential leakage of session-bound or user-specific data through the shared cache. Earlier unsupported Django versions (5.0.x, 4.1.x, 3.2.x) may also be vulnerable but have not been formally evaluated by the Django project.

Business impact

Organizations running Django applications that rely on caching for performance may inadvertently expose user-specific data such as personalized content, session information, or other sensitive details. The impact varies by application design: a site that caches user dashboards, shopping carts, or private communications faces higher risk. Since the vulnerability requires specific request conditions and user interaction, the real-world attack surface is limited, but the consequences of exploitation—unauthorized access to private user data—carry reputational and compliance implications. Applications with strict data segregation requirements or handling regulated data should prioritize assessment.

Affected systems

Django 6.0.0 through 6.0.6 and Django 5.2.0 through 5.2.15 are confirmed affected. Django maintainers have not officially evaluated unsupported series 5.0.x, 4.1.x, and 3.2.x, though they may be vulnerable due to shared caching logic. Organizations using the `cache_page()` decorator or `UpdateCacheMiddleware` are directly exposed. Applications that do not use Django's built-in caching mechanisms are not affected.

Exploitability

This vulnerability requires network access and user interaction (CVSS vector: AV:N/AC:H/PR:N/UI:R). The attacker cannot exploit it passively; they must craft specific requests that trigger cache hits and must have some ability to influence the caching behavior or request patterns. The moderate complexity (AC:H) stems from the need to align request timing and cookie conditions. This is not a trivial exploit but remains achievable in multi-user environments where cache behavior is predictable. No public exploit code or proof-of-concept is currently known, and the vulnerability is not tracked on the CISA Known Exploited Vulnerabilities (KEV) catalog.

Remediation

Upgrade Django to version 6.0.7 or later for the 6.0 series, or to version 5.2.16 or later for the 5.2 series. These patches correct the cache key generation logic to properly account for cookie variations. After patching, verify cache behavior in test environments, especially for applications that depend on session-based or personalized caching. Organizations running unsupported Django versions should migrate to a supported release as soon as feasible; if immediate migration is not possible, implement cache invalidation strategies or disable middleware-level caching pending remediation.

Patch guidance

Apply Django security updates as follows: For Django 6.0, upgrade to 6.0.7 or any subsequent release. For Django 5.2, upgrade to 5.2.16 or any subsequent release. For unsupported series, review the vendor advisory and security announcements to determine if patches are available. Test patches in a staging environment to confirm cache behavior and application functionality remain intact. Because this vulnerability affects caching behavior, monitor application logs and cache hit/miss ratios after patching to ensure proper operation. Consider scheduling patching during low-traffic windows to minimize performance impact during the transition.

Detection guidance

Monitor web server and application logs for unusual cache-related behavior, such as unexpected cache hits or requests from different IP addresses returning identical cached content. If your Django application logs cache operations, look for patterns where unrelated cookie values correlate with identical cached responses. Network-based detection is difficult because the vulnerability manifests as legitimate cache behavior; focus on application-level inspection. Check Django application settings to identify use of `cache_page()` or `UpdateCacheMiddleware`, as these are the attack surface. If caching is not critical to your deployment, temporarily disabling it can serve as a temporary mitigation while patches are tested.

Why prioritize this

Although rated CVSS 3.1 (LOW) due to high attack complexity and user interaction requirements, this vulnerability warrants prompt attention for organizations handling sensitive user data. The core issue—unintended data leakage via shared caches—has compliance implications for regulated industries. Prioritization should reflect your application's use of Django caching and the sensitivity of cached data. Applications serving multiple distinct user communities or handling PII should treat this as medium-priority; those using simple static caching may defer until regular patch cycles.

Risk score, explained

The CVSS 3.1 score of 3.1 reflects: Network accessibility (AV:N), high attack complexity due to the specific conditions required to trigger cache misalignment (AC:H), no privilege requirement (PR:N), requirement for user interaction to trigger the vulnerable code path (UI:R), unchanged scope (S:U), and limited confidentiality impact (C:L) with no integrity or availability impact (I:N/A:N). The score appropriately discounts the severity because exploitation is not straightforward and does not grant system-level access. However, the actual risk to an organization depends on data sensitivity and cache usage patterns.

Frequently asked questions

Does this affect my Django application if I don't use caching?

No. The vulnerability is specific to `UpdateCacheMiddleware` and the `cache_page()` decorator. If your Django application does not use these caching features, you are not affected.

Can an attacker directly read any user's data, or only cached data?

Only cached data is exposed. The vulnerability allows an attacker to retrieve responses that were cached for other users under certain cookie conditions. Non-cached data or data not served through these middleware is not at risk.

Does the CISA Known Exploited Vulnerabilities list track this issue?

No. As of the publication date, CVE-2026-48588 is not listed on the CISA KEV catalog, indicating no known active exploitation in the wild. However, this does not guarantee exploitation will not occur and should not delay patching for affected deployments.

What should I do if I'm running Django 4.1.x or 3.2.x?

Django has not officially evaluated these unsupported versions, but they may contain the same vulnerability. Verify against Django's security announcements. Regardless, migrating from unsupported versions to Django 5.2 LTS or 6.0 LTS should be a separate security priority. In the interim, review your caching strategy and consider disabling `cache_page()` or middleware caching if feasible.

This analysis is based on the published CVE record and Django security advisories as of the publication date. Exploitation scenarios and risk assessments are general; consult your application architecture and data classification to determine actual organizational risk. Patch version numbers and timelines should be verified against official Django release notes and security advisories. No exploit code or weaponized proof-of-concept is included or endorsed. This document is provided for informational purposes and does not constitute professional security advice. Source: NVD (public-domain), retrieved 2026-08-16. Analysis generated by SEC.co (claude-haiku-4-5).