From patchwork Mon Jun 24 13:53:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 167583 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp4260291ilk; Mon, 24 Jun 2019 06:53:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRk60ZTtXJY5bkcvqu62QVBpJFaJkGeFo1wBIy2xnMCHGohq2CsOF1Tz8023Av+QKgd4Hg X-Received: by 2002:a17:90a:e397:: with SMTP id b23mr25115781pjz.117.1561384434734; Mon, 24 Jun 2019 06:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561384434; cv=none; d=google.com; s=arc-20160816; b=HDQLpSR06HsFbw8H5hiM8f3z7UWg07fn2rgevQFUg4HOLq0BnKW7ZglTRPxWSbhjdz DU1TaYJfKn+M44IRPvACu1hfHv6KIFixWHoTPhRMkBZHr4+svDsLthh/cw5OPUnPbFkD Y9ralKR8b64MURXEzvO41x5w0P4EovOrePXMTn1jJXnoAZhiQLFDJAjqTzWBgmiJDI7Q 0fviGP67QNfrlz/bIPycGKoKdjY65upQ6t3FIzoSbs5oBxCqgP8RhsEJIh53ABv9pT5/ NJi9qvsWvHZkWyX/hE1GGEdpzQ8JX/i2169dV+95i9bhsrunkvygIFD4oTDp3Hbzmnv2 uKHw== 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=frTc2fgsiPa2MfPoFekwWr0tDG8gpoDgM7em1Y0k8HkCOrGuNCXYRnD/EyI6HdO+Wu wquLRhMTurncTR4oS+Yw5ARrt47blDgrV95X1D335rewhyyzduKf3OfAqf4whZI35U4s uYi3bQlNSQwMEJgaAo7rk37zBKag6KbMUPLJ3uZxz5TOZ0003vyCzCdVVGVVPgxIyxqr ouu7w+NXvcm2PAvnzeLsTscfJFemBGLkAX8cc26OzxM54uU+4AphmZzQN6HsP//1karE fdQQdgcn8rwZPaxisara6PWmPaxzQbQ7A5XJkqGGpz+OaCci9qrD1Nfg3VPXjM+PmlH6 jY+A== 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=QmM+Cd60; 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 m20si11375249pjn.40.2019.06.24.06.53.54; Mon, 24 Jun 2019 06:53:54 -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=QmM+Cd60; 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 12D9D7E3AA; Mon, 24 Jun 2019 13:53:52 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mail.openembedded.org (Postfix) with ESMTP id A4F4E7E3B0 for ; Mon, 24 Jun 2019 13:53:29 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id s15so13466058wmj.3 for ; Mon, 24 Jun 2019 06:53:31 -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=QmM+Cd60NDDm3O1BwJy6wXl5qBGPq0rAX8YJFRDuPspAk+JKyofzYhoSwAJkC1f2Yj VkstbMFZvofyNsShWeZsvFkpwgTQ3UdaatKnVfuHM4uz2Fvfzrr4geYVU9ipWPaPkXBN V0FagwlEQzS8Mdkyv2D/kuOdkQryp6IfOkAvPINZDOKx31XN3F90YqBFDlDI0tC7341s 9/k9F7fP5tt7suldGBrrCBK1RNVZRfNhKexMuoRgXt6vDWdplVB2YjTxxui4iE/9xlCt lCD2aow8nz6Sk/FutIAdWambqF5dRNPS1as7Ah4vnRoxBcmhEm++3vBTYgLxQO58dAXm q8ng== 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=Jd41Frwq6vYpK3FMn0wF9NMh8H6XOSYrT82s1yt/ljbs1mPM+Os4oDTuSbwaOPWc1m YjUAx6kWhtZufWd1KrnFOo/KOUrzR9lZkaDxUQg3HMVWJXBlKXQyIQmVKaJcdP43oZ+L xyWZYW7IT5mQPk32cItppcISB7JQnDHki08l5V61IzB2gepNf1bzuwX2iTHr1lqmxDcU Ql+qTMaxR0jpLJhUd4+3UXGfnevPh4FpIB4saXoB00+G3UPiczSUIiCmEGlFqv1tuE5q cHZ0qwA4R9PejwvC+yR8Wjr7yvsxDJZ7Ln4Orz0OwzEMl1prJhvVvM5kzKdyzAfal+Kh +S1A== X-Gm-Message-State: APjAAAW677rQBZKp3wGRukfDgEpRI3njGbPn2+He6FTooZugVFiC2e4R QFGdV6k3jIFXlq7ydXCYwbPBnjAvtcc= X-Received: by 2002:a1c:7614:: with SMTP id r20mr17036976wmc.142.1561384410181; Mon, 24 Jun 2019 06:53:30 -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 v67sm15080977wme.24.2019.06.24.06.53.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Jun 2019 06:53:29 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Mon, 24 Jun 2019 14:53:27 +0100 Message-Id: <20190624135327.32443-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH][thud] 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"