Skip to contentSkip to conversation

squid: CVE-2016-2569, CVE-2016-2570, CVE-2016-2571, CVE-2016-2572

PATCH New Catalin Enache 1 participant 1 message Apr 4, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 squid: CVE-2016-2569, CVE-2016-2570, CVE-2016-2571, CVE-2016-2572

Due to incorrect bounds checking Squid is vulnerable to a denial of service attack when processing HTTP responses.

These problems allow remote servers delivering certain unusual HTTP response syntax to trigger a denial of service for all clients accessing the Squid service.

HTTP responses containing malformed headers that trigger this issue are becoming common. We are not certain at this time if that is a sign of malware or just broken server scripting.

Details of a trivial attack are already circulating publicly.

Backported squid 3.5 patches referenced here:
http://www.squid-cache.org/Advisories/SQUID-2016_2.txt

---
 ...ling-of-huge-response-headers.-Fewer-BUG-.patch |  43 ++++
 ...ead-of-asserting-on-some-String-overflows.patch | 260 +++++++++++++++++++++
 ...sertion-failed-String.cc-len_-len-65536-i.patch |  68 ++++++
 ...dState.cc-447-serverConnection-conn-asser.patch | 219 +++++++++++++++++
 ...dState.cc-447-serverConnection-conn-asser.patch |  33 +++
 .../recipes-daemons/squid/squid_3.5.7.bb           |   5 +
 6 files changed, 628 insertions(+)
 create mode 100644 meta-networking/recipes-daemons/squid/files/0001-Better-handling-of-huge-response-headers.-Fewer-BUG-.patch
 create mode 100644 meta-networking/recipes-daemons/squid/files/0002-Throw-instead-of-asserting-on-some-String-overflows.patch
 create mode 100644 meta-networking/recipes-daemons/squid/files/0003-Bug-3870-assertion-failed-String.cc-len_-len-65536-i.patch
 create mode 100644 meta-networking/recipes-daemons/squid/files/0004-Bug-4447-FwdState.cc-447-serverConnection-conn-asser.patch
 create mode 100644 meta-networking/recipes-daemons/squid/files/0005-Bug-4447-FwdState.cc-447-serverConnection-conn-asser.patch
meta-networking/recipes-daemons/squid/files/0001-Better-handling-of-huge-response-headers.-Fewer-BUG-.patch new file +40 -0
new file mode 100644
index 0000000..714f57a
@@ -0,0 +1,43 @@
+From 4633c819a43d9abd29f58a06c1becca6b4661efa Mon Sep 17 00:00:00 2001
+From: Catalin Enache <[email protected]>
+Date: Mon, 28 Mar 2016 11:41:12 +0300
+Subject: [PATCH 1/5] Better handling of huge response headers. Fewer "BUG
+ 3279" messages.
+
+When we failed to parse a response, do not store the fake half-baked
+response (via a replaceHttpReply() call). Doing so leads to misleading
+"BUG 3279: HTTP reply without Date" messages (at best).  The fake
+response is only meant for continueAfterParsingHeader().
+
+Also removed a misleading XXX that may have caused Bug 4432 in v4.0
+(trunk r14548).
+
+Commiter: Alex Rousskov <[email protected]>
+Signed-off-by: Catalin Enache <[email protected]>
+---
+ src/http.cc | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/src/http.cc b/src/http.cc
+index a5584ba..492a97b 100644
+--- a/src/http.cc
++++ b/src/http.cc
+@@ -719,11 +719,8 @@ HttpStateData::processReplyHeader()
+         if (!parsed && error > 0) { // unrecoverable parsing error
+             debugs(11, 3, "processReplyHeader: Non-HTTP-compliant header: '" <<  readBuf->content() << "'");
+             flags.headers_parsed = true;
+-            // XXX: when sanityCheck is gone and Http::StatusLine is used to parse,
+-            //   the sline should be already set the appropriate values during that parser stage
+             newrep->sline.set(Http::ProtocolVersion(1,1), error);
+-            HttpReply *vrep = setVirginReply(newrep);
+-            entry->replaceHttpReply(vrep);
++            setVirginReply(newrep);
+             ctx_exit(ctx);
+             return;
+         }
+-- 
+2.7.4
+
meta-networking/recipes-daemons/squid/files/0002-Throw-instead-of-asserting-on-some-String-overflows.patch new file +257 -0

257 lines not on this page · raw message

meta-networking/recipes-daemons/squid/files/0003-Bug-3870-assertion-failed-String.cc-len_-len-65536-i.patch new file +65 -0

65 lines not on this page · raw message

meta-networking/recipes-daemons/squid/files/0004-Bug-4447-FwdState.cc-447-serverConnection-conn-asser.patch new file +216 -0

216 lines not on this page · raw message

meta-networking/recipes-daemons/squid/files/0005-Bug-4447-FwdState.cc-447-serverConnection-conn-asser.patch new file +30 -0
new file mode 100644
index 0000000..7ca43bc
@@ -0,0 +1,33 @@
+From a60b123eecb119ae32205cff892603e20785c4d8 Mon Sep 17 00:00:00 2001
+From: Christos Tsantilas <[email protected]>
+Date: Mon, 29 Feb 2016 22:00:34 +0200
+Subject: [PATCH 5/5] Bug 4447:FwdState.cc:447 "serverConnection() == conn"
+ assertion, part2
+
+Fix to allow make check  work again.
+
+Commiter: Christos Tsantilas <[email protected]>
+Signed-off-by: Catalin Enache <[email protected]>
+---
+ src/tests/stub_comm.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/tests/stub_comm.cc b/src/tests/stub_comm.cc
+index abd3a6b..746ec92 100644
+--- a/src/tests/stub_comm.cc
++++ b/src/tests/stub_comm.cc
+@@ -57,7 +57,7 @@ int commUnsetConnTimeout(const Comm::ConnectionPointer &conn) STUB_RETVAL(-1)
+ int ignoreErrno(int ierrno) STUB_RETVAL(-1)
+ void commCloseAllSockets(void) STUB
+ void checkTimeouts(void) STUB
+-void comm_add_close_handler(int fd, CLCB *, void *) STUB
++AsyncCall::Pointer comm_add_close_handler(int fd, CLCB *, void *) STUB
+ void comm_add_close_handler(int fd, AsyncCall::Pointer &) STUB
+ void comm_remove_close_handler(int fd, CLCB *, void *) STUB
+ void comm_remove_close_handler(int fd, AsyncCall::Pointer &)STUB
+-- 
+2.7.4
+
meta-networking/recipes-daemons/squid/squid_3.5.7.bb +5 -0
index 5b27d46..9d57d34 100644
@@ -19,6 +19,11 @@ SRC_URI = "http://www.squid-cache.org/Versions/v${MAJ_VER}/${MIN_VER}/${BPN}-${P
            file://squid-use-serial-tests-config-needed-by-ptest.patch \
            file://run-ptest \
            file://volatiles.03_squid \
+           file://0001-Better-handling-of-huge-response-headers.-Fewer-BUG-.patch \
+           file://0002-Throw-instead-of-asserting-on-some-String-overflows.patch \
+           file://0003-Bug-3870-assertion-failed-String.cc-len_-len-65536-i.patch \
+           file://0004-Bug-4447-FwdState.cc-447-serverConnection-conn-asser.patch \
+           file://0005-Bug-4447-FwdState.cc-447-serverConnection-conn-asser.patch \
 "
 
 LIC_FILES_CHKSUM = "file://COPYING;md5=c492e2d6d32ec5c1aad0e0609a141ce9 \
Signature · 1 line
2.7.4