From patchwork Tue Jun 25 12:37:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 167719 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp5499531ilk; Tue, 25 Jun 2019 05:38:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRpHd4hSgsf7QXp2aURNk77jfj//cr5CycGlS9oqD6VqblpgXe0cPzHzZgEhRc9oSRrPuy X-Received: by 2002:a17:902:7603:: with SMTP id k3mr47688325pll.245.1561466282320; Tue, 25 Jun 2019 05:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561466282; cv=none; d=google.com; s=arc-20160816; b=hEUikuFUT4taG3cfrbl9nhcDLmBaDWRIcb6tbj6rGZ+5uRWV7UDXgIwbBdFFafpHli L7AjBCaanFhxSg8lFFuiHNXgrWxfP2an8UX9HEiJjOjK+GTq8Wbz8ChuT1XWJGcgpi+W OzUXF6Vtx2dzdExkZeKZcXkveatZUi+E1pv5KBtvmck3AvIMCRe2QYFzmRZxCUMQhP2c k2/rVCoZdZw6+5JGc1u0pP9bRbe7QWnEBX76VGz1t94pqd/fb5yd44s+k4+MbRP9X2Ti fod3w1T0YeOZqegl6niluHU3qWmdqOGE0DpHOBwMocQ0mI8EjrZb2DOlPjhDjW7nsj3b Ke7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=rLNwaPrXOVTySg15Tx0C/8MmibkIwZ0KalWaHHgvAp4=; b=rfFNlFRCs1ChC7gviaP0YL5CMhHFCy09k7Af8kIYXtf4pJn/Md9e12CHAE7x+Q14ht 06YUWemc/Div51KUaRIAiFX1sTKmZgGJWWDDemMAfMsgAT7TjsXDJa6UUlCKz7kfLHiw 7dXFvY9f828pTXSW2H599qee8o5Q1OGHhDMf6rqCgQsqABxXHEN0KV6IXLBE70YeLkBN co6cGtW5nVjvhebx4sKbzOrzjokS286ppu5ZWqF6eqlkU97LpgAUgmJkS1CUooz39ywS e8BlDVmK+P5aKcSY7RmrasaWHNFuDkR6/4QJr1VGokrwyyZB8Elvne5VLbUwZeRhg/pS OqjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="yQxJL7/A"; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id d24si13252319pgk.186.2019.06.25.05.38.01; Tue, 25 Jun 2019 05:38:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="yQxJL7/A"; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 8CDB07E27B; Tue, 25 Jun 2019 12:37:58 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mail.openembedded.org (Postfix) with ESMTP id 80F5A7E269 for ; Tue, 25 Jun 2019 12:37:56 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id k11so17721625wrl.1 for ; Tue, 25 Jun 2019 05:37:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=YmaIpnuM5zDc+2plodB1m+LLYcZYZvYRW3VBV9ZESqY=; b=yQxJL7/A5FLMB+xf0TeaPL9osdn9AC9qWSL+NJKRaZxgFm4WpGPxpa8mFGstFgRtab IQ7a1nuaSh4rhGjYUI/mSDiTCL0/bJw9WNwfSRM7B41oESeSHbyXsKINrB9gAmvCyaWu NvyKYOg/UB3yJ2Ne4thrCU3RrEwDgT3DgBQwXmOUDEZkBdw2Ep4xVA55t7AgP/kNlFAs pD7p7nZ1QXq+CEpcH5+L1Xua01XWsc8eOUwjIzuzL7Dam6/0/1RqpEfBTV7hX1U1PfTp y3Q+SiClqQs59x5kh5/pWqvv95PglfjnugXo1d/yiPPHf2Ap5ollv7IG6iQQmeiWsBrE Adfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=YmaIpnuM5zDc+2plodB1m+LLYcZYZvYRW3VBV9ZESqY=; b=Fwq74GJ7nAqQlg6pLIz6lETtLVGau/j3cxy6Z8WZxfjxLz7nZD+Z5UDKyHQ/8wB9oC yIeMLlzdp0ldXSeH78SBqU8aX1eULS1HFikhgB5z0t4Z8BpuJNeAwLakhL25YJqHkBPa 8Q5JtmkOGIHpSTfsZGHN9MXpMJIqcJh7XEpJMQDHvImVTFbFfpdS/eb0XeBUA/CxjTEb 9Qs241nE52AbFpE7Murp48xX/ZebBYWbY8f5eOCxAzizMksLSqf3IWmSCfIUF4Y7WE7S gzzvuN2bz122y1S+TDi6z6+C7PyCY9tDfxB9BqTfpSsNhXzJHumi/vWaM/X58wKSQN40 B1pA== X-Gm-Message-State: APjAAAX6AC7BjIf5zo7HI0vANhBi1l1DVMErNhIkM4/M7oEOg1aReDnk HkhaJmoSL1FGC0rfEDmou5yhkdN3sQ8= X-Received: by 2002:adf:e691:: with SMTP id r17mr61520846wrm.67.1561466276860; Tue, 25 Jun 2019 05:37:56 -0700 (PDT) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id j189sm2975116wmb.48.2019.06.25.05.37.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2019 05:37:56 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 25 Jun 2019 13:37:52 +0100 Message-Id: <20190625123753.18465-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH][thud 1/2] lighttpd: fix CVE-2019-11072 X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Signed-off-by: Ross Burton --- .../lighttpd/lighttpd/fix-http-parseopts.patch | 51 ++++++++++++++++++++++ meta/recipes-extended/lighttpd/lighttpd_1.4.51.bb | 1 + 2 files changed, 52 insertions(+) create mode 100644 meta/recipes-extended/lighttpd/lighttpd/fix-http-parseopts.patch -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-extended/lighttpd/lighttpd/fix-http-parseopts.patch b/meta/recipes-extended/lighttpd/lighttpd/fix-http-parseopts.patch new file mode 100644 index 00000000000..f3a0402c4be --- /dev/null +++ b/meta/recipes-extended/lighttpd/lighttpd/fix-http-parseopts.patch @@ -0,0 +1,51 @@ +CVE: CVE-2019-11072 +Upstream-Status: Backport +Signed-off-by: Ross Burton + +From 32120d5b8b3203fc21ccb9eafb0eaf824bb59354 Mon Sep 17 00:00:00 2001 +From: Glenn Strauss +Date: Wed, 10 Apr 2019 11:28:10 -0400 +Subject: [PATCH] [core] fix abort in http-parseopts (fixes #2945) + +fix abort in server.http-parseopts with url-path-2f-decode enabled + +(thx stze) + +x-ref: + "Security - SIGABRT during GET request handling with url-path-2f-decode enabled" + https://redmine.lighttpd.net/issues/2945 +--- + src/burl.c | 6 ++++-- + src/t/test_burl.c | 2 ++ + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/burl.c b/src/burl.c +index 51182628..c4b928fd 100644 +--- a/src/burl.c ++++ b/src/burl.c +@@ -252,8 +252,10 @@ static int burl_normalize_2F_to_slash_fix (buffer *b, int qs, int i) + } + } + if (qs >= 0) { +- memmove(s+j, s+qs, blen - qs); +- j += blen - qs; ++ const int qslen = blen - qs; ++ memmove(s+j, s+qs, (size_t)qslen); ++ qs = j; ++ j += qslen; + } + buffer_string_set_length(b, j); + return qs; +diff --git a/src/t/test_burl.c b/src/t/test_burl.c +index 7be9be50..f7a16815 100644 +--- a/src/t/test_burl.c ++++ b/src/t/test_burl.c +@@ -97,6 +97,8 @@ static void test_burl_normalize (void) { + flags |= HTTP_PARSEOPT_URL_NORMALIZE_PATH_2F_DECODE; + run_burl_normalize(psrc, ptmp, flags, __LINE__, CONST_STR_LEN("/a/b?c=/"), CONST_STR_LEN("/a/b?c=/")); + run_burl_normalize(psrc, ptmp, flags, __LINE__, CONST_STR_LEN("/a/b?c=%2f"), CONST_STR_LEN("/a/b?c=/")); ++ run_burl_normalize(psrc, ptmp, flags, __LINE__, CONST_STR_LEN("%2f?"), CONST_STR_LEN("/?")); ++ run_burl_normalize(psrc, ptmp, flags, __LINE__, CONST_STR_LEN("/%2f?"), CONST_STR_LEN("//?")); + run_burl_normalize(psrc, ptmp, flags, __LINE__, CONST_STR_LEN("/a%2fb"), CONST_STR_LEN("/a/b")); + run_burl_normalize(psrc, ptmp, flags, __LINE__, CONST_STR_LEN("/a%2Fb"), CONST_STR_LEN("/a/b")); + run_burl_normalize(psrc, ptmp, flags, __LINE__, CONST_STR_LEN("/a%2fb?c=/"), CONST_STR_LEN("/a/b?c=/")); diff --git a/meta/recipes-extended/lighttpd/lighttpd_1.4.51.bb b/meta/recipes-extended/lighttpd/lighttpd_1.4.51.bb index f28fd2f6905..5c828da5b06 100644 --- a/meta/recipes-extended/lighttpd/lighttpd_1.4.51.bb +++ b/meta/recipes-extended/lighttpd/lighttpd_1.4.51.bb @@ -18,6 +18,7 @@ SRC_URI = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${PV}.t file://lighttpd \ file://lighttpd.service \ file://0001-Use-pkg-config-for-pcre-dependency-instead-of-config.patch \ + file://fix-http-parseopts.patch \ " SRC_URI[md5sum] = "6e68c19601af332fa3c5f174245f59bf"