]> git.ipfire.org Git - thirdparty/squid.git/commit
Certificate Validator buffer-overflow crashes Squid
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 25 Jul 2016 10:22:54 +0000 (13:22 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 25 Jul 2016 10:22:54 +0000 (13:22 +0300)
commitddc77a2e9f0a68604f05708796071487f4dfe3ea
tree6c6bd8314d958fafbcb743aff441015b23be1c6f
parentf62759c58e836c7de131869bb1340ec5db4f8a14
Certificate Validator buffer-overflow crashes Squid

Certain server certificates with a large chain and/or large certificates
(i.e. due to excessive amount of SAN entries) are producing helper requests and
replies which are larger than the 32KB limit set in src/helper.cc.

The major problem for squid is that the helper response should fit in the
helper read buffer. Currently squid starts with 4K request buffer and if
required may increase the buffer size up to 32K.

This patch:
  - Uses a constant-size read buffer for helpers and accumulates the helper
    response to Helper::Reply object.
  - Changes the HelperServerBase::requests list to hold list of the new
    Helper::Xaction class which holds pairs of Helper::Request and
    Helper::Reply objects
  - Modifies the Helper::Reply class to accumulate data and restricts the
    required memory allocations

This is a Measurement Factory project
src/MemBuf.cc
src/MemBuf.h
src/client_side_request.cc
src/helper.cc
src/helper.h
src/helper/Reply.cc
src/helper/Reply.h
src/redirect.cc
src/ssl/helper.cc