In Vinyl Cache before 9.0.1 and Varnish Cache before 9.0.3, a deficiency in HTTP/2 request parsing can be exploited to launch a backend request desync
attack (request smuggling), which in turn can be used for cache poisoning,
authentication bypass, or possibly even information disclosure and manipulation. The attack vector only exists if HTTP/2 support is enabled by setting the
feature parameter to contain +http2. HTTP/2 support is disabled by
default.
http2 enabled
exploitable URLs present (require request body)
6.0 plain VCL mitigationFor version 6.0 LTS, this method works in pure VCL with no other changes
required. The following snippet needs to be added at the top of the custom VCL:
<h2>BEGIN vsv19 mitigation</h2>
<h1></h1>
sub recv_vsv19 {
unset req.http.vsv19;
if (req.proto != "HTTP/2.0" || ! req.http.content-length) {
return;
}
set req.http.vsv19 = "1";
set req.http.content-length = req.http.content-length;
}
sub vcl_recv {
call recv_vsv19;
}
sub vcl_backend_fetch {
if (bereq.http.vsv19) {
set bereq.http.Connection = "close";
}
}
<h1></h1>
<h2>END vsv19 mitigation</h2>
In addition, care must be taken that bereq.http.Connection is not unset
anywhere else in the custom VCL.