This keyword covers all known keywords together. It is essentially used
to enable or disable all checks at once.
+ - delete-all-trailer-fields (inbound, request and response)
+ Deletes from requests and responses any trailer field, regardless of
+ its content or syntax. This is done after syntactic checks though. The
+ vast majority of public facing applications do not use trailers because
+ they are not reliable (intermediaries are allowed to drop or fold them)
+ and their presence on public networks is generally associated with
+ attack attempts. It is generally safe to drop them by default on public
+ facing listeners, and even on servers meant to deliver public contents,
+ in order to avoid any information leakage. Note that gRPC services use
+ them, in responses only.
+
- delete-underscore-in-header-name (inbound, request and response)
Deletes from requests and responses any header field whose name
contains an underscore character ('_' or \x5C). While this character is
#define HTTP_HRD_DEL_USCORE_TLR_NAM 0x00000020
#define HTTP_HRD_DEL_UNREG_HDR 0x00000040
#define HTTP_HRD_DEL_UNREG_TLR 0x00000080
+#define HTTP_HRD_DEL_ALL_TLR 0x00000100
/* insert new masks above this line */
#define HTTP_HRD_ALL 0xFFFFFFFF
{ "delete-underscore-in-trailer-name", HTTP_HRD_DEL_USCORE_TLR_NAM, HTTP_DIR_BOTH },
{ "delete-unregistered-header-fields",HTTP_HRD_DEL_UNREG_HDR, HTTP_DIR_BOTH },
{ "delete-unregistered-trailer-fields",HTTP_HRD_DEL_UNREG_TLR, HTTP_DIR_BOTH },
+ { "delete-all-trailer-fields", HTTP_HRD_DEL_ALL_TLR, HTTP_DIR_BOTH },
/* insert new hardening options above this line */
{ "all", HTTP_HRD_ALL, HTTP_DIR_BOTH },
{ NULL, 0 }
goto fail;
}
+ /* we may have to delete any trailer (we do that after syntax check) */
+ if (unlikely(http_harden(HTTP_HRD_DEL_ALL_TLR))) {
+ /* skip it, so it won't be added */
+ continue;
+ }
+
/* we may have to delete trailers with underscores
* in their names. These ones are already marked
* as found when not rejected so we can avoid a