From patchwork Sun Jul 21 14:25:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Kuster X-Patchwork-Id: 169320 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp6412469ilk; Sun, 21 Jul 2019 07:29:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4lYbzqd/Unxi861nzIERoATVTbwMtlZoLJ4iS+g0365IuKqxTof08oLGX3ExPrmroF1Od X-Received: by 2002:a17:90a:206a:: with SMTP id n97mr71869505pjc.10.1563719396669; Sun, 21 Jul 2019 07:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563719396; cv=none; d=google.com; s=arc-20160816; b=m/jtQ8ejL5FD5JwVUuK4Is3uFqt3mACpC0fqIX4JEuKEfHBuCNU52PY6MN3KHkyPDQ kGUUvF4AFDui9y46vrAkBR2mbkq3FS4Rx75bscaaIG0ylueRcM2Q6M02bk8L5yAx3i/n cPOJ6i+/BPas4nDEUSfZon3xQJzPNnY3AMQlzC2e+6Kn6CcHPWRfFaMjVuzH5WgwbFTD 9N6kIeOEdnxOt3f9wt6uAvGt1QX2VDeci3/Ec5cn8lrbJKrrmRdDIQ+Iobx6che+qiiM WN1MDSVUF1zDfumrbqJhQyVmWD0Rm6DR61+HB2WbTDHW5WK7W5OdXC0dc09W9K5A64V/ 0P6g== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=Fv4TNz1VvKb2Z3T1btjoQbt8mZxm+2BlkFk2XtkTtLM=; b=I9j0HMsEoPyf+KJSgDgFGdcug+T+ENF57RfQZViKcyyXjFhQXxsi9Clh7yoo5HDI+X 6oh90AYUEl1KxfYwWy2RIQZMJnoASy62HJhkx4TcjkaX/CY5DcjoNriV1i1mYN4nhlv9 HvZ0AOIgdSJOH2Sy3UZE/KwEu4SQumZmH+reqkyotTAA82nys+kSLv/7NBkDjWC3JhJ0 FHtbdp2EZVj0fXsgJv75yVP8c+KHbsphsjZ8ykfuh4IvZahiQC9ekUQUaS8/Pk+YtsQN Buk+Me6qIDWJQQ+3EFIuHo9pbi9ColrSI31t7wcFDx5Mi/Ce00sBMz1ZvQxlJDG4Zil7 C/8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=dNZMnzyi; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id 12si7287184pfi.199.2019.07.21.07.29.56; Sun, 21 Jul 2019 07:29:56 -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=@gmail.com header.s=20161025 header.b=dNZMnzyi; 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=QUARANTINE dis=NONE) header.from=gmail.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 11FCE7F0A7; Sun, 21 Jul 2019 14:26:50 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mail.openembedded.org (Postfix) with ESMTP id 238127EE4F for ; Sun, 21 Jul 2019 14:25:47 +0000 (UTC) Received: by mail-pl1-f171.google.com with SMTP id m9so17808051pls.8 for ; Sun, 21 Jul 2019 07:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=/nt0ErfpvOJadmsi5U3vsasjtwSucOvfJ9h1qaHoNSk=; b=dNZMnzyi774MVZlsGJG3wNomfGYTXNVWY0mqJmlQR3KW4yfNm6g6Cqop6FxZOoTanv IEfSITJIayRshVCbxqWrtUxvBLlxSAL0NWcECD21qcUL+VRrKhbwJZMgajQsnGM8qs0C KOWdzjxUAnIDPzx55G6E/8VgJa7RuCbrZZi6o/dv6fVMo5lTjMO8nsgMhBCfDWANhk08 GZ9PhCi/XWHk874KzjlLuXsK5h32L/sSdHTGxdiy3oGpuXQ5dpKA9VwEvP6Vn90Drpk5 fnjZaW5Bk6/CqNOVfxrVyvPIGZ84RH1qLuIIh3gSThnzdV7WGbDnCv09B+rJS21m7yTg bafg== 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:in-reply-to :references; bh=/nt0ErfpvOJadmsi5U3vsasjtwSucOvfJ9h1qaHoNSk=; b=cIgIQEjeKA7XH+3dsjnEiVcd9zHVDyH4jRFcYr0hroaElbyzod5LQy3pK1VgmYoFRn 8z02GZsEQsBPFKjkIxFX54TIuFcR2LGUWgDh4IfGBDfzer44T65QrdfoT09rKNJWqJmS JSrk1nRT5JmJMot2/xheOQF0oKWSq4bdi+7/kiL6z4I6ILyiYXSx7Hp3SFjQGmrJNVR0 uiAaBanqgJnNJ/y9qIoZcAVNWmgb8UL0ppGDg2HRwDQFjym+adL9SleEjeqm79ob7KIw 1hSc6pJ++nR+S2JJRTiR35RouR84oPut7/rjAn0VMUfS9CiQz2f9SMW8bX2NvVz4s3Oh Ds4A== X-Gm-Message-State: APjAAAWGy8MuvsCdXIuOc2UDkKnuMFL79nnZCzuszQwC3wQUZsCyKQKE Yq7gvhq/7By/2aRU2QroAsNcvXPv X-Received: by 2002:a17:902:20e9:: with SMTP id v38mr70964613plg.62.1563719149122; Sun, 21 Jul 2019 07:25:49 -0700 (PDT) Received: from akuster-ThinkPad-T460s.hsd1.ca.comcast.net ([2601:202:4180:c33:bd4d:a6f4:da99:27b4]) by smtp.gmail.com with ESMTPSA id a3sm28807750pfc.70.2019.07.21.07.25.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Jul 2019 07:25:48 -0700 (PDT) From: Armin Kuster To: openembedded-core@lists.openembedded.org Date: Sun, 21 Jul 2019 07:25:15 -0700 Message-Id: <0dbd16a40a28bb75962f38c6ce450c909c22ee79.1563719003.git.akuster808@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Subject: [OE-core] [thud] 26/30] 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 From: Ross Burton Signed-off-by: Ross Burton Signed-off-by: Armin Kuster --- .../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.7.4 -- _______________________________________________ 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 0000000..f3a0402 --- /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 f28fd2f..5c828da 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"