Two tests of the accepted HTTP violations were wrong. In
h1_headers_to_hdr_list(), HTTP_VIO_HDR_VALUE_NUL was used as a mask
instead of a bit position. So the NUL character in a header value was
accepted or rejected depending on the "fragment-in-url" and the
"status-code-long" violations. And in h1_process_res_vsn(), the
response version string was checked against the acceptable request
violations instead of the response ones.
This patch must be backported to 3.5.
* (like CR and LF).
*/
if (h1m->err_pos < -1 || /* PR_O2_R*BUG_OK not set */
- (!(h1m->flags & H1_MF_RESP) && !(global.acc_hreq_vio & HTTP_VIO_HDR_VALUE_NUL)) ||
- ((h1m->flags & H1_MF_RESP) && !(global.acc_hres_vio & HTTP_VIO_HDR_VALUE_NUL))) {
+ (!(h1m->flags & H1_MF_RESP) && !(global.acc_hreq_vio & (1U << HTTP_VIO_HDR_VALUE_NUL))) ||
+ ((h1m->flags & H1_MF_RESP) && !(global.acc_hres_vio & (1U << HTTP_VIO_HDR_VALUE_NUL)))) {
state = H1_MSG_HDR_VAL;
goto http_msg_invalid;
}
* exactly one digit "." one digit. This check may be disabled using
* option accept-unsafe-violations-in-http-response.
*/
- if (h1m->err_pos < -1 || !(global.acc_hreq_vio & (1U << HTTP_VIO_VERSION_STRING))) { /* PR_O2_RSPBUG_OK not set */
+ if (h1m->err_pos < -1 || !(global.acc_hres_vio & (1U << HTTP_VIO_VERSION_STRING))) { /* PR_O2_RSPBUG_OK not set */
if (sl->st.v.len != 8)
return 0;