#36560: When the Cache-Control header is set to no-store, the response is
cached.
-------------------------------------+-------------------------------------
Reporter: mengxun | Owner: mengxun
Type: | Status: closed
Cleanup/optimization |
Component: HTTP handling | Version: 5.2
Severity: Normal | Resolution: fixed
Keywords: cache | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia <124304+nessita@…>):
In [changeset:"27f74d02c08731c0352593a6d1dda255451dad10" 27f74d0]:
{{{#!CommitTicketReference repository=""
revision="27f74d02c08731c0352593a6d1dda255451dad10"
[6.1.x] Refs #36560, CVE-2026-35193 -- Recognized qualified cache-control
directives.
The switch from substring matching to exact token membership in
142b881cecaddc334cabec139e701c0e4b9798da caused qualified directive
forms permitted by RFC 9111 (e.g. `Cache-Control: private="Set-Cookie"`)
to be missed, allowing such responses to be stored in a shared cache.
This work added a new `split_directive_names()` helper that yields the
lowercased directive name from each token, dropping any qualified value
and stripping whitespace around "=", so qualified forms reduce to their
directive name. `UpdateCacheMiddleware` now uses it so `private`,
`no-cache`, and `no-store` (and the `public` exception for
`Authorization`) match regardless of qualified form.
Aligned `ConditionalGetMiddleware.needs_etag()` to use the same helper,
since it relied on the same brittle exact-token check. Sharing one
helper keeps the two directive lookups consistent and means malformed
input (e.g. `no-store="x"`) now correctly suppresses the `ETag` instead
of being silently ignored.
Also stripped whitespace around `=` in `patch_cache_control`'s directive
parsing so a qualified directive with stray whitespace is still
recognized.
Thanks to Jacob Walls for reviews.
Backport of b461519bf5973d7fc149560d2f99acdba71a437d from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36560#comment:13>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019ee0c4666f-4fd50008-aa31-4ff6-939f-e38f87bf289e-000000%40eu-central-1.amazonses.com.