#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 nessita <124304+nessita@…>):

 In [changeset:"b461519bf5973d7fc149560d2f99acdba71a437d" b461519b]:
 {{{#!CommitTicketReference repository=""
 revision="b461519bf5973d7fc149560d2f99acdba71a437d"
 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.
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36560#comment:12>
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/0107019ee0b86a36-40f347a7-e257-46a7-9ad4-1e615336dbf6-000000%40eu-central-1.amazonses.com.

Reply via email to