Skip to content

Commit

Permalink
Mark req doclose when failing to ignore req body
Browse files Browse the repository at this point in the history
Previously we would ignore errors to iterate the request body into
oblivion in VRB_Ignore(), keeping the connection open. This opens an
out-of-sync vulnerability on H/1 connections.

This patch tests the status of the request body in VRB_Ignore(), marking
the request failed and that it should be closed on errors.
  • Loading branch information
mbgrydeland committed Jan 11, 2022
1 parent 9ebad0c commit dcbe8b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/varnishd/cache/cache_req_body.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ VRB_Ignore(struct req *req)
if (req->req_body_status == REQ_BODY_WITH_LEN ||
req->req_body_status == REQ_BODY_WITHOUT_LEN)
(void)VRB_Iterate(req, httpq_req_body_discard, NULL);
if (req->req_body_status == REQ_BODY_FAIL)
req->doclose = SC_RX_BODY;
return(0);
}

Expand Down

0 comments on commit dcbe8b9

Please sign in to comment.