Opened 6 years ago

Closed 6 years ago

#454 closed design (invalid)

Caching 412 Responses

Reported by: mnot@… Owned by: draft-ietf-httpbis-p6-cache@…
Priority: normal Milestone: unassigned
Component: p6-cache Severity: In WG Last Call
Keywords: Cc:

Description (last modified by mnot@…)

RFC2616 and the HTTPbis drafts allow an intermediary to cache a 412 response to a request with an If-Match header, if the response contains appropriate Cache-Control headers.

My understanding of the specifications is that the intermediary is then within its right to serve the cached 412 response in response to subsequent GET requests that do not contain an If-Match header (see bottom of this mail for an example set of requests/responses that illustrate what I'm trying to describe).

This seems problematic because if an attacker knows an origin returns cacheable 412 responses, the attacker could fill the cache with 412 responses for a set of URLs (from that origin) by making spurious If-Match requests it knows will return 412 responses, and those 412 responses would subsequently be served up to other clients instead of the 'real' response the origin would have given if the 412 was not cacheable or if the attacker had not poisoned the intermediary's cache with 412s.

I was wondering whether this is a gap in the spec and cacheable 412 responses should have an explicit (or implicit?) Vary: If-Match semantic associated with them?

Or, whether it is purposely the way it is and is a case of providing the rope and letting people hang themselves if they so choose (Origin servers can always add the Vary: header if they care about cache poisoning, intermediaries can always not cache 412 responses, etc.).

An example (with only the relevant Headers included for compactness) of what I am talking about would be:

First request:

    GET /foo HTTP/1.1
    Host: example.com
    If-Match: "thisisnotanetag"

    HTTP/1.1 412 Precondition Failed
    Cache-Control: max-age=900
    ...rest of response...

Subsequent request:

    GET /foo HTTP/1.1
    Host: example.com

    HTTP/1.1 412 Precondition Failed
    Age: 10
    Cache-Control: max-age=900
    ...rest of response...

Change History (2)

comment:1 Changed 6 years ago by mnot@…

  • Description modified (diff)

comment:2 Changed 6 years ago by mnot@…

  • Resolution set to invalid
  • Status changed from new to closed

See list discussion.

Note: See TracTickets for help on using tickets.