Hi everyone,
I'm seeing some odd behaviour with App Engine Flex and Cloud Endpoints that might be prone to Host Header Injection.
If I send a request to the root domain of my API running on AppEngine Flex with Cloud Endpoints, with a specified HOST header, the content of the specified host is loaded as the content if the redirects are followed.
Request:
GET / HTTP/1.1
HOST:
evil.host.comResponse:
302 to resolved domain
http://evil.host.com/some-evil-url.htmlAs far as I understood from the Endpoints Team, there is no way to configure the ESP to check the headers for the origin host and reject based on an allowed list or pattern.
With AppEngine Flex it would be the responsibility of the application to handle this.
However if the request is made against the root path, my application does not receive the request to handle it.
According to the documentation
https://cloud.google.com/endpoints/docs/openapi/openapi-limitations#operations_on_url_root_path_it is not possible to provide an implementation for the root path.
Are there any other ways to prevent this behaviour and protect against Host Header Injection?