.. _envoy_v3_api_file_envoy/extensions/http/header_validators/envoy_default/v3/header_validator.proto: Envoy's default Header Validator config (proto) =============================================== .. _envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig: extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig ------------------------------------------------------------------------ :repo:`[extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig proto] ` This extension validates that HTTP request and response headers are well formed according to respective RFCs. #. HTTP/1 header map validity according to `RFC 7230 section 3.2 `_ #. Syntax of HTTP/1 request target URI and response status #. HTTP/2 header map validity according to `RFC 7540 section 8.1.2 `_ #. Syntax of HTTP/2 pseudo headers #. HTTP/3 header map validity according to `RFC 9114 section 4.3 `_ #. Syntax of HTTP/3 pseudo headers #. Syntax of Content-Length and Transfer-Encoding #. Validation of HTTP/1 requests with both ``Content-Length`` and ``Transfer-Encoding`` headers #. Normalization of the URI path according to `Normalization and Comparison `_ without `case normalization `_ .. code-block:: json :force: { "http1_protocol_options": {...}, "uri_path_normalization_options": {...}, "restrict_http_methods": ..., "headers_with_underscores_action": ... } .. _envoy_v3_api_field_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.http1_protocol_options: http1_protocol_options (:ref:`extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.Http1ProtocolOptions `) .. _envoy_v3_api_field_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.uri_path_normalization_options: uri_path_normalization_options (:ref:`extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions `) The URI path normalization options. By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions `. URI path transformations specified by the ``uri_path_normalization_options`` configuration can be applied to a portion of requests by setting the ``envoy_default_header_validator.uri_path_transformations`` runtime value. Caution: disabling path normalization may lead to path confusion vulnerabilities in access control or incorrect service selection. .. _envoy_v3_api_field_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.restrict_http_methods: restrict_http_methods (`bool `_) Restrict HTTP methods to these defined in the `RFC 7231 section 4.1 `_ Envoy will respond with 400 to requests with disallowed methods. By default methods with arbitrary names are accepted. .. _envoy_v3_api_field_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.headers_with_underscores_action: headers_with_underscores_action (:ref:`extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.HeadersWithUnderscoresAction `) Action to take when a client request with a header name containing underscore characters is received. If this setting is not specified, the value defaults to ALLOW. .. _envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions: extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions ---------------------------------------------------------------------------------------------------- :repo:`[extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions proto] ` .. code-block:: json :force: { "skip_path_normalization": ..., "skip_merging_slashes": ..., "path_with_escaped_slashes_action": ... } .. _envoy_v3_api_field_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.skip_path_normalization: skip_path_normalization (`bool `_) Should paths be normalized according to RFC 3986? This operation overwrites the original request URI path and the new path is used for processing of the request by HTTP filters and proxied to the upstream service. Envoy will respond with 400 to requests with malformed paths that fail path normalization. The default behavior is to normalize the path. This value may be overridden by the runtime variable :ref:`http_connection_manager.normalize_path`. See `Normalization and Comparison `_ for details of normalization. Note that Envoy does not perform `case normalization `_ URI path normalization can be applied to a portion of requests by setting the ``envoy_default_header_validator.path_normalization`` runtime value. .. _envoy_v3_api_field_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.skip_merging_slashes: skip_merging_slashes (`bool `_) Determines if adjacent slashes in the path are merged into one. This operation overwrites the original request URI path and the new path is used for processing of the request by HTTP filters and proxied to the upstream service. Setting this option to true will cause incoming requests with path ``//dir///file`` to not match against route with ``prefix`` match set to ``/dir``. Defaults to ``false``. Note that slash merging is not part of `HTTP spec `_ and is provided for convenience. Merging of slashes in URI path can be applied to a portion of requests by setting the ``envoy_default_header_validator.merge_slashes`` runtime value. .. _envoy_v3_api_field_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.path_with_escaped_slashes_action: path_with_escaped_slashes_action (:ref:`extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.PathWithEscapedSlashesAction `) The action to take when request URL path contains escaped slash sequences (``%2F``, ``%2f``, ``%5C`` and ``%5c``). This operation may overwrite the original request URI path and the new path is used for processing of the request by HTTP filters and proxied to the upstream service. .. _envoy_v3_api_enum_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.PathWithEscapedSlashesAction: Enum extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.PathWithEscapedSlashesAction -------------------------------------------------------------------------------------------------------------------------------------- :repo:`[extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.PathWithEscapedSlashesAction proto] ` Determines the action for requests that contain ``%2F``, ``%2f``, ``%5C`` or ``%5c`` sequences in the URI path. This operation occurs before URL normalization and the merge slashes transformations if they were enabled. .. _envoy_v3_api_enum_value_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.PathWithEscapedSlashesAction.IMPLEMENTATION_SPECIFIC_DEFAULT: IMPLEMENTATION_SPECIFIC_DEFAULT *(DEFAULT)* ⁣Default behavior specific to implementation (i.e. Envoy) of this configuration option. Envoy, by default, takes the ``KEEP_UNCHANGED`` action. NOTE: the implementation may change the default behavior at-will. .. _envoy_v3_api_enum_value_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.PathWithEscapedSlashesAction.KEEP_UNCHANGED: KEEP_UNCHANGED ⁣Keep escaped slashes. .. _envoy_v3_api_enum_value_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.PathWithEscapedSlashesAction.REJECT_REQUEST: REJECT_REQUEST ⁣Reject client request with the 400 status. gRPC requests will be rejected with the ``INTERNAL`` (13) error code. The ``http#.downstream_rq_failed_path_normalization`` counter is incremented for each rejected request. .. _envoy_v3_api_enum_value_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.PathWithEscapedSlashesAction.UNESCAPE_AND_REDIRECT: UNESCAPE_AND_REDIRECT ⁣Unescape ``%2F`` and ``%5C`` sequences and redirect the request to the new path if these sequences were present. The redirect occurs after path normalization and merge slashes transformations if they were configured. NOTE: gRPC requests will be rejected with the ``INTERNAL`` (13) error code. This option minimizes possibility of path confusion exploits by forcing request with unescaped slashes to traverse all parties: downstream client, intermediate proxies, Envoy and upstream server. The ``http#.downstream_rq_redirected_with_normalized_path`` counter is incremented for each redirected request. .. _envoy_v3_api_enum_value_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.UriPathNormalizationOptions.PathWithEscapedSlashesAction.UNESCAPE_AND_FORWARD: UNESCAPE_AND_FORWARD ⁣Unescape ``%2F`` and ``%5C`` sequences. Note: this option should not be enabled if intermediaries perform path based access control as it may lead to path confusion vulnerabilities. .. _envoy_v3_api_msg_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.Http1ProtocolOptions: extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.Http1ProtocolOptions --------------------------------------------------------------------------------------------- :repo:`[extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.Http1ProtocolOptions proto] ` .. code-block:: json :force: { "allow_chunked_length": ... } .. _envoy_v3_api_field_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.Http1ProtocolOptions.allow_chunked_length: allow_chunked_length (`bool `_) Allows Envoy to process HTTP/1 requests/responses with both ``Content-Length`` and ``Transfer-Encoding`` headers set. By default such messages are rejected, but if option is enabled - Envoy will remove the ``Content-Length`` header and process the message. See `RFC7230, sec. 3.3.3 `_ for details. .. attention:: Enabling this option might lead to request smuggling vulnerabilities, especially if traffic is proxied via multiple layers of proxies. .. _envoy_v3_api_enum_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.HeadersWithUnderscoresAction: Enum extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.HeadersWithUnderscoresAction ---------------------------------------------------------------------------------------------------------- :repo:`[extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.HeadersWithUnderscoresAction proto] ` Action to take when Envoy receives client request with header names containing underscore characters. Underscore character is allowed in header names by the RFC-7230 and this behavior is implemented as a security measure due to systems that treat '_' and '-' as interchangeable. Envoy by default allows client request headers with underscore characters. .. _envoy_v3_api_enum_value_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.HeadersWithUnderscoresAction.ALLOW: ALLOW *(DEFAULT)* ⁣Allow headers with underscores. This is the default behavior. .. _envoy_v3_api_enum_value_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.HeadersWithUnderscoresAction.REJECT_REQUEST: REJECT_REQUEST ⁣Reject client request. HTTP/1 requests are rejected with the 400 status. HTTP/2 requests end with the stream reset. The :ref:`httpN.requests_rejected_with_underscores_in_headers ` counter is incremented for each rejected request. .. _envoy_v3_api_enum_value_extensions.http.header_validators.envoy_default.v3.HeaderValidatorConfig.HeadersWithUnderscoresAction.DROP_HEADER: DROP_HEADER ⁣Drop the client header with name containing underscores. The header is dropped before the filter chain is invoked and as such filters will not see dropped headers. The :ref:`httpN.dropped_headers_with_underscores ` is incremented for each dropped header.