Skip to content

Commit c75a93b

Browse files
committedJul 11, 2017
Unconditionally remove proxy headers to prevent httpoxy
See https://httpoxy.org/ for more details. Signed-off-by: Simo Sorce <[email protected]>
1 parent 1c8af8b commit c75a93b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
 

‎images/router/haproxy/conf/haproxy-config.template

+10-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,10 @@ frontend public
171171
{{- if (eq .StatsPort -1) }}
172172
monitor-uri /_______internal_router_healthz
173173
{{- end }}
174-
174+
175+
# Strip off Proxy headers to prevent HTTpoxy (https://httpoxy.org/)
176+
http-request del-header Proxy
177+
175178
# DNS labels are case insensitive (RFC 4343), we need to convert the hostname into lowercase
176179
# before matching, or any requests containing uppercase characters will never match.
177180
http-request set-header Host %[req.hdr(Host),lower]
@@ -235,6 +238,9 @@ frontend fe_sni
235238
{{- ""}} crt-list /var/lib/haproxy/conf/cert_config.map accept-proxy
236239
mode http
237240

241+
# Strip off Proxy headers to prevent HTTpoxy (https://httpoxy.org/)
242+
http-request del-header Proxy
243+
238244
# DNS labels are case insensitive (RFC 4343), we need to convert the hostname into lowercase
239245
# before matching, or any requests containing uppercase characters will never match.
240246
http-request set-header Host %[req.hdr(Host),lower]
@@ -273,6 +279,9 @@ frontend fe_no_sni
273279
bind 127.0.0.1:{{env "ROUTER_SERVICE_NO_SNI_PORT" "10443"}} ssl no-sslv3 {{ if gt (len .DefaultCertificate) 0 }}crt {{.DefaultCertificate}}{{ else }}crt /var/lib/haproxy/conf/default_pub_keys.pem{{ end }} accept-proxy
274280
mode http
275281

282+
# Strip off Proxy headers to prevent HTTpoxy (https://httpoxy.org/)
283+
http-request del-header Proxy
284+
276285
# DNS labels are case insensitive (RFC 4343), we need to convert the hostname into lowercase
277286
# before matching, or any requests containing uppercase characters will never match.
278287
http-request set-header Host %[req.hdr(Host),lower]

0 commit comments

Comments
 (0)
Please sign in to comment.