Skip to content

v1.7.3

Choose a tag to compare

@umputun umputun released this 31 Oct 05:49
· 4 commits to master since this release
e51d166

This release closes a Host header injection. With a wildcard or regex server and $host in the destination, a client could steer the request to an upstream of its choice: a $1 in the Host header pulled path groups into the destination, and over HTTP/2, where the Host check of HTTP/1 does not apply, / and # could change the upstream host. In either protocol, %2f in the host turned into a path separator. Reproxy now escapes $ in substituted host values and answers 400 for a Host header that fails host-header validation or contains %, over HTTP/1 and HTTP/2 alike.

Destinations can also use the groups of a regex server as ${host.1}, ${host.2} and so on, so one rule can route aaaa.example.com/some to aaaa.foo.com/some. Host values are inserted without URL escaping, so use anchored, tight captures such as ^([a-z0-9-]+)\.example\.com$. See the host substitution section in the README.

Bug Fixes

  • block Host header injection into destinations #268 @umputun

Improvements

  • add ${host.N} for regex server groups in destinations #268 @umputun