No standard header/trailer name exists with underscores, and these are
sometimes converted to the same variable name as the ones with a dash by
some application frameworks or CGI/FCGI, causing confusion. Let's just
drop them by default from untrusted peers (we don't deny these requests
nor responses though).
#define HTTP_HRD_DEFAULT HTTP_HRD_NONE
/* default contents of the implicit "untrusted" and "trusted" profiles */
-#define HTTP_HRD_UNTRUSTED_DEFAULT (HTTP_HRD_REJ_LCASE_METHOD | \
- HTTP_HRD_REJ_HDR_FOLD | \
- HTTP_HRD_REJ_CTL_IN_HDR | \
- HTTP_HRD_REJ_CL_TE | \
+#define HTTP_HRD_UNTRUSTED_DEFAULT (HTTP_HRD_REJ_LCASE_METHOD | \
+ HTTP_HRD_REJ_HDR_FOLD | \
+ HTTP_HRD_REJ_CTL_IN_HDR | \
+ HTTP_HRD_DEL_USCORE_HDR_NAM | \
+ HTTP_HRD_DEL_USCORE_TLR_NAM | \
+ HTTP_HRD_REJ_CL_TE | \
HTTP_HRD_REJ_CL_LEAD_ZERO)
#define HTTP_HRD_TRUSTED_DEFAULT HTTP_HRD_DEFAULT
expect !~ " on\n"
send "show http-hardening untrusted"
- expect ~ " 1 reject-duplicate-host-header +req +off\n 2 reject-lowercase-method +req +on\n 3 reject-underscore-in-header-name +- +off\n 4 reject-underscore-in-trailer-name +- +off\n 5 delete-underscore-in-header-name +- +off\n 6 delete-underscore-in-trailer-name +- +off\n 7 delete-unregistered-header-fields +- +off\n 8 delete-unregistered-trailer-fields +- +off\n 9 delete-all-trailer-fields +- +off\n10 reject-header-trailer-folding +- +on\n11 reject-ctl-in-header-trailer +- +on\n12 reject-content-length-with-te +- +on\n13 reject-content-length-leading-zero +- +on\n"
+ expect ~ " 1 reject-duplicate-host-header +req +off\n 2 reject-lowercase-method +req +on\n 3 reject-underscore-in-header-name +- +off\n 4 reject-underscore-in-trailer-name +- +off\n 5 delete-underscore-in-header-name +- +on\n 6 delete-underscore-in-trailer-name +- +on\n 7 delete-unregistered-header-fields +- +off\n 8 delete-unregistered-trailer-fields +- +off\n 9 delete-all-trailer-fields +- +off\n10 reject-header-trailer-folding +- +on\n11 reject-ctl-in-header-trailer +- +on\n12 reject-content-length-with-te +- +on\n13 reject-content-length-leading-zero +- +on\n"
send "show http-hardening other"
expect ~ " 2 reject-lowercase-method +req +off\n(.*\n)*10 reject-header-trailer-folding +- +on\n"