pvillard31 commented on code in PR #11335:
URL: https://github.com/apache/nifi/pull/11335#discussion_r3407356018
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/connector/ProxyHeaderValidatorCustomizer.java:
##########
@@ -95,11 +98,14 @@ private void processProxyHostHeaders(final Request request)
{
final HttpFields requestHeaders = request.getHeaders();
for (final String proxyHostHeader : SUPPORTED_PROXY_HOST_HEADERS) {
- final String hostHeader = requestHeaders.get(proxyHostHeader);
+ String hostHeader = requestHeaders.get(proxyHostHeader);
// Include empty and blank values for enforced validation of
request headers
if (hostHeader == null) {
continue;
}
+
+ hostHeader = HOST_PORT_SEPARATOR.split(hostHeader)[0];
Review Comment:
After the port is stripped here, it is no longer checked against the
configured ports in `validPorts`, but `StandardRequestUriProvider.getPort`
still reads that port from the header to build redirect URLs. Should the header
port be validated against the allowed ports so a request like
`X-Forwarded-Host: validhost:6666` cannot pass an arbitrary port through?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]