<div dir="ltr"><font face="monospace">VSV00010 Varnish Request Smuggling Vulnerability<br>================================================<br><br>Date: 2022-11-08<br><br>A request smuggling attack can be performed on Varnish Cache servers by<br>requesting that certain headers are made hop-by-hop, preventing the<br>Varnish Cache servers from forwarding critical headers to the<br>backend. Among the headers that can be filtered this way are both<br>`Content-Length` and `Host`, making it possible for an attacker to both<br>break the HTTP/1 protocol framing, and bypass request to host routing<br>in VCL.<br><br>Versions affected<br>-----------------<br><br>* Varnish Cache releases 7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.1.0, 7.1.1, 7.2.0<br><br>Versions not affected<br>---------------------<br><br>* Varnish Cache 7.1.2 (released 2022-11-08)<br><br>* Varnish Cache 7.2.1 (released 2022-11-08)<br><br>* All versions of Varnish Cache 6.0 LTS series and Varnish Cache Plus by<br>  Varnish Software.<br><br>* GitHub Varnish Cache master branch at commit e40007dfc2243fb5b3be9923f1ed22dfebb90002<br><br>Mitigation<br>----------<br><br>If upgrading Varnish is not possible, it is possible to mitigate the<br>problem by adding the following snippet at the beginning of the `vcl_recv`<br>VCL function::<br><br>  sub vcl_recv {<br>      # Start of mitigation for VSV00010<br>      # Tip: Expand the regular expression token list to allow<br>      # additional tokens, e.g.<br>      # "(close|keep-alive|te|upgrade|http2-settings|my-header)"<br>      if (regsuball(req.http.connection,<br>          "(?i)((close|keep-alive|te|upgrade|http2-settings)[ ,]*)", "") !~ "^[ ,]*$") {<br>          return (synth(400));<br>      }<br>  }<br><br>This VCL statement would ensure that any attempt to add anything but the<br>frequently used tokens like `close`, `keep-alive`, `TE`, `Upgrade` and<br>`HTTP2-Settings` in an incoming `Connection`-header would be answered with<br>a 400 "Bad request" synthetic response.<br><br>Note that some sites may need to allow other header names as tokens in the<br>`Connection`-header to function properly. If that is the case for your<br>site, add any additional headers needed like the commented tip suggests.<br><br>Credits<br>-------<br><br>This problem was discovered and reported to us by Martin van Kervel<br>Smedshammer, Graduate Student at the University of Oslo. We wish to thank<br>him for the responsible disclosure.</font><br></div>