[squid-users] Vary object loop returns
squid3 at treenet.co.nz
Wed Jun 8 06:48:02 UTC 2016
On 8/06/2016 8:21 a.m., Heiler Bemerguy wrote:
> Some servers will reply like this, trying to avoid caching at any cost
> (I think):
> HTTP/1.1 200 OK
> Server: nginx
> Content-Type: image/x-icon
> Last-Modified: Tue, 07 Jun 2016 11:16:55 GMT
> ETag: "5756ad27-47e"
> Content-Length: 1150
> X-Suppressed-Cache-Control: max-age=600
> Cache-Control: private, max-age=0, must-revalidate
> X-Suppressed-Expires: Tue, 07 Jun 2016 20:07:36 GMT
> Expires: Thu, 01 Jan 1970 00:00:00 GMT
> Date: Tue, 07 Jun 2016 19:57:36 GMT
> X-Varnish: 510207311
> Then our squid will create a vary object with all that information,
> giving this bomb: httpMakeVaryMark:
> if-none-match="%225756ad27-47e%22", if-modified-since,
> accept-encoding="none", x-client-locale,
> It's squid "fault" to convert spaces and symbols to %values, and I think
> no sanity check is performed on it..
There are at least three sanity checks/protections performed.
1) the client request headers must parse according to HTTP rules. If
any one of them dont Squid either wont get this far, or will be treating
that header as non-existent/empty.
2) as of 3.5.19 the total length of the expansion must be short enough
to store in a limited string buffer (~64KB). The recent CVE-2016-* set
of issues happened because it was possible to get past this sometimes.
3) the header field values are RFC1738 encoded as they are added to the
sub-key to ensure it complies with HTTP octet requirements and prevent
log based attacks. Thats the %-encoding you see in the logs.
> still, I don't see the code where
> it checks if all this info from the new client is identical to the
> stored one.. and I don't know where the "loop" comes from...
That is a set of separate checks deeper inside store itself which are
performed for every lookup, not just Vary sub-key lookups. One of which
is to compare the URL of the found object with the active request. The
second of which you found with your extra debug already.
More information about the squid-users