A request smuggling attack can be performed on HTTP/1 connections on Varnish Cache and Varnish Enterprise servers. The smuggled request would be treated as an additional request by the Varnish server, go through normal VCL processing, and injected as a spurious response on the client connection.
This problem was discovered and reported to us by James Kettle, Director of Research at PortSwigger. We wish to thank him for the responsible disclosure.
The potential impact is information disclosure and cache poisoning.
The recommended solution is to upgrade Varnish to one of the versions where this issue has been resolved, and then ensure that Varnish is restarted.
You should already have configured the Varnish Enterprise repository, so a normal upgrade will be enough:
sudo yum update varnish-plus
sudo systemctl restart varnish
Verify that the version that is installed is recent:
rpm -q varnish-plus
varnish-plus-6.0.9r4-1.el7.x86_64
You should already have configured the Varnish Enterprise repository, so a normal upgrade should be enough:
sudo apt-get update
sudo apt-get install --only-upgrade varnish-plus
sudo systemctl restart varnish
Verify that the version that is installed is recent:
dpkg -l varnish-plus
[...]
ii varnish-plus 6.0.9r4-1~xenial amd64 A supercharged version of the popular web cache, Varnish Cache
If upgrading Varnish is not possible, it is possible to mitigate the problem by ensuring that the Varnish Server does not allow connection reuse on HTTP/1 client connections once a request body has been seen on the connection. To deploy the workaround, put the following VCL configuration towards the top of the VCL configuration::
sub vsv8 {
if ((req.http.Content-Length || req.http.Transfer-Encoding) &&
req.proto != "HTTP/2.0") {
set resp.http.Connection = "close";
}
}
sub vcl_synth { call vsv8; }
sub vcl_deliver { call vsv8; }
Smuggled requests will show in the logs generated by Varnish as normal requests. It may be possible to identify the smuggled requests by comparing the Varnish logs with logs from any proxy software between the Varnish server and the client.
2021-12-17
2021-12-18
2021-12-21
2022-01-07
2022-01-25