You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This extension validates that HTTP request and response headers are well formed according to respective RFCs.
17
17
//
18
-
// #. HTTP/1 header map validity according to `RFC 7230 section 3.2 <https://datatracker.ietf.org/doc/html/rfc7230#section-3.2>`_
19
-
// #. Syntax of HTTP/1 request target URI and response status
20
-
// #. HTTP/2 header map validity according to `RFC 7540 section 8.1.2 <https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2>`_
21
-
// #. Syntax of HTTP/2 pseudo headers
22
-
// #. HTTP/3 header map validity according to `RFC 9114 section 4.3 <https://www.rfc-editor.org/rfc/rfc9114.html>`_
23
-
// #. Syntax of HTTP/3 pseudo headers
24
-
// #. Syntax of Content-Length and Transfer-Encoding
25
-
// #. Validation of HTTP/1 requests with both ``Content-Length`` and ``Transfer-Encoding`` headers
18
+
// The validator performs comprehensive HTTP header validation including:
19
+
//
20
+
// #. HTTP/1 header map validity according to `RFC 7230 section 3.2 <https://datatracker.ietf.org/doc/html/rfc7230#section-3.2>`_.
21
+
// #. Syntax of HTTP/1 request target URI and response status.
22
+
// #. HTTP/2 header map validity according to `RFC 7540 section 8.1.2 <https://datatracker.ietf.org/doc/html/rfc7540#section-8.1.2>`_.
23
+
// #. Syntax of HTTP/2 pseudo headers.
24
+
// #. HTTP/3 header map validity according to `RFC 9114 section 4.3 <https://www.rfc-editor.org/rfc/rfc9114.html>`_.
25
+
// #. Syntax of HTTP/3 pseudo headers.
26
+
// #. Syntax of Content-Length and Transfer-Encoding.
27
+
// #. Validation of HTTP/1 requests with both ``Content-Length`` and ``Transfer-Encoding`` headers.
26
28
// #. Normalization of the URI path according to `Normalization and Comparison <https://datatracker.ietf.org/doc/html/rfc3986#section-6>`_
27
-
// without `case normalization <https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2.1>`_
29
+
// without `case normalization <https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2.1>`_.
30
+
//
31
+
// This validator ensures that HTTP traffic processed by Envoy conforms to established
32
+
// standards and helps prevent issues caused by malformed headers or invalid HTTP syntax.
28
33
//
29
34
// [#comment:TODO(yanavlasov): Put #extension: envoy.http.header_validators.envoy_default after it is not hidden any more]
30
35
// [#next-free-field: 6]
31
36
messageHeaderValidatorConfig {
32
37
// Action to take when Envoy receives client request with header names containing underscore
33
38
// characters.
34
-
// Underscore character is allowed in header names by the RFC-7230 and this behavior is implemented
35
-
// as a security measure due to systems that treat '_' and '-' as interchangeable. Envoy by default allows client request headers with underscore
36
-
// characters.
39
+
//
40
+
// Underscore character is allowed in header names by RFC-7230, and this behavior is implemented
41
+
// as a security measure due to systems that treat ``_`` and ``-`` as interchangeable. Envoy by
42
+
// default allows client request headers with underscore characters.
43
+
//
44
+
// This setting provides control over how to handle such headers for security and compatibility reasons.
37
45
enumHeadersWithUnderscoresAction {
38
46
// Allow headers with underscores. This is the default behavior.
// See `Normalization and Comparison <https://datatracker.ietf.org/doc/html/rfc3986#section-6>`_
// Determines if adjacent slashes in the path are merged into one.
139
+
//
101
140
// This operation overwrites the original request URI path and the new path is used for processing of
102
141
// the request by HTTP filters and proxied to the upstream service.
103
-
// Setting this option to true will cause incoming requests with path ``//dir///file`` to not match against
104
-
// route with ``prefix`` match set to ``/dir``. Defaults to ``false``. Note that slash merging is not part of
105
-
// `HTTP spec <https://datatracker.ietf.org/doc/html/rfc3986>`_ and is provided for convenience.
106
-
// Merging of slashes in URI path can be applied to a portion of requests by setting the
// Setting this option to ``true`` will cause incoming requests with path ``//dir///file`` to not match against
143
+
// route with ``prefix`` match set to ``/dir``. Defaults to ``false``.
144
+
//
145
+
// .. note::
146
+
//
147
+
// Slash merging is not part of the
148
+
// `HTTP spec <https://datatracker.ietf.org/doc/html/rfc3986>`_ and is provided for convenience.
149
+
// Merging of slashes in URI path can be applied to a portion of requests by setting the
// HTTP/1 protocol specific options for header validation.
166
+
//
167
+
// These options control how Envoy handles HTTP/1 specific behaviors and edge cases
168
+
// that may not apply to HTTP/2 or HTTP/3 protocols.
117
169
messageHttp1ProtocolOptions {
118
170
// Allows Envoy to process HTTP/1 requests/responses with both ``Content-Length`` and ``Transfer-Encoding``
119
171
// headers set. By default such messages are rejected, but if option is enabled - Envoy will
120
172
// remove the ``Content-Length`` header and process the message.
173
+
//
121
174
// See `RFC7230, sec. 3.3.3 <https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.3>`_ for details.
122
175
//
123
176
// .. attention::
177
+
//
124
178
// Enabling this option might lead to request smuggling vulnerabilities, especially if traffic
125
179
// is proxied via multiple layers of proxies.
180
+
//
126
181
boolallow_chunked_length=1;
127
182
}
128
183
184
+
// HTTP/1 protocol specific options.
185
+
// These settings control HTTP/1 specific validation behaviors.
129
186
Http1ProtocolOptionshttp1_protocol_options=1;
130
187
131
188
// The URI path normalization options.
189
+
//
132
190
// By default Envoy normalizes URI path using the default values of the :ref:`UriPathNormalizationOptions
// Restrict HTTP methods to these defined in the `RFC 7231 section 4.1 <https://datatracker.ietf.org/doc/html/rfc7231#section-4.1>`_
202
+
// Restrict HTTP methods to these defined in the `RFC 7231 section 4.1 <https://datatracker.ietf.org/doc/html/rfc7231#section-4.1>`_.
203
+
//
141
204
// Envoy will respond with 400 to requests with disallowed methods.
142
205
// By default methods with arbitrary names are accepted.
206
+
//
207
+
// This setting helps enforce HTTP compliance and can prevent attacks that rely on
208
+
// non-standard HTTP methods.
143
209
boolrestrict_http_methods=3;
144
210
145
211
// Action to take when a client request with a header name containing underscore characters is received.
146
-
// If this setting is not specified, the value defaults to ALLOW.
212
+
//
213
+
// If this setting is not specified, the value defaults to ``ALLOW``.
214
+
//
215
+
// This setting provides security control over headers with underscores, which can be a source
216
+
// of security issues when different systems interpret underscores and hyphens differently.
0 commit comments