From patchwork Tue Jan 15 14:05:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Famulari X-Patchwork-Id: 745 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B868816A76; Tue, 15 Jan 2019 14:45:09 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 81BCE16A3A for ; Tue, 15 Jan 2019 14:45:08 +0000 (GMT) Received: from localhost ([127.0.0.1]:40237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjPxj-0006wd-IZ for patchwork@mira.cbaines.net; Tue, 15 Jan 2019 09:45:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjPZT-00046t-DK for guix-patches@gnu.org; Tue, 15 Jan 2019 09:20:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjPZS-0004ga-Aj for guix-patches@gnu.org; Tue, 15 Jan 2019 09:20:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60351) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gjPZS-0004g5-7x for guix-patches@gnu.org; Tue, 15 Jan 2019 09:20:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gjPZR-00043t-N2 for guix-patches@gnu.org; Tue, 15 Jan 2019 09:20:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#34084] [PATCH] gnu: OpenSSH: Fix CVE-2018-20685. Resent-From: Leo Famulari Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 15 Jan 2019 14:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34084 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34084@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154756196715559 (code B ref -1); Tue, 15 Jan 2019 14:20:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Jan 2019 14:19:27 +0000 Received: from localhost ([127.0.0.1]:59632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjPYs-00042s-Eg for submit@debbugs.gnu.org; Tue, 15 Jan 2019 09:19:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjPYo-00042b-7r for submit@debbugs.gnu.org; Tue, 15 Jan 2019 09:19:22 -0500 Received: from lists.gnu.org ([209.51.188.17]:56249) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjPYi-0004H9-5X for submit@debbugs.gnu.org; Tue, 15 Jan 2019 09:19:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjPYg-0002jb-S4 for guix-patches@gnu.org; Tue, 15 Jan 2019 09:19:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjPLh-0007TE-Qw for guix-patches@gnu.org; Tue, 15 Jan 2019 09:05:53 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:46287) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjPLh-0007QP-KD for guix-patches@gnu.org; Tue, 15 Jan 2019 09:05:49 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B9E8C28D9A; Tue, 15 Jan 2019 09:05:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 15 Jan 2019 09:05:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; s=mesmtp; bh=LPPoQOKw953S46QF/Srj2+Q obCmerHtDdpEuZm5jxb8=; b=LTS1RScsRsuRnNJm7WdZOwXVKS8L0B3oQrqFAcW PhQUn47j3y0ISGrBUc6Bv2gvgnw9++Kv6NfKe5/DTvhEGSeD9scFyypPAskz0yM9 hK+tPYfe2NDE8XKbtbpLwx0taQatLxuAP1J6kWlotDqeNO5t1WL7C7Mt54OYRLzP l9ls= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=LPPoQOKw953S46QF/ Srj2+QobCmerHtDdpEuZm5jxb8=; b=JVkYHmtNvacCNXsNnFjc0ktA14u8IjuFP gGgEdFTWgAT6YvyS1wf5Nt8HfLRFXey1gHcIRaDxieqjAZXlpvTyTewpAumOu27v G8hPUDc2QJ+W7E53NsQXv2q5D20MHdMx0mJw6ehPkbH2aR+wby71WuwfPO0Fw0En y0XPTto4PCMh4E5CCha5pLIU8rvhS2RNt1ZtTYRQgYeVQ9+2FQUpoQ+3QEYAyf8f HJDejthGg4hm9Z94ztqCLZ10HSF1epLErmkaY5CHLc1D/up4PlRaKkjxGzaRecW1 Bhh++tirVgMcSerI0Jok7sojwJ7Hwmd82bTwmiIuF2td7rLvRaf7Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrgeefgdehkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthenuceurghilhhouhhtmecufedt tdenucenucfjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepnfgvoh cuhfgrmhhulhgrrhhiuceolhgvohesfhgrmhhulhgrrhhirdhnrghmvgeqnecuffhomhgr ihhnpehmihhtrhgvrdhorhhgpdhgihhthhhusgdrtghomhenucfkphepudejvddrheekrd dvtddurddvtdeknecurfgrrhgrmhepmhgrihhlfhhrohhmpehlvghosehfrghmuhhlrghr ihdrnhgrmhgvnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from jasmine.lan (unknown [172.58.201.208]) by mail.messagingengine.com (Postfix) with ESMTPA id F0DF5E462B for ; Tue, 15 Jan 2019 09:05:45 -0500 (EST) From: Leo Famulari Date: Tue, 15 Jan 2019 09:05:41 -0500 Message-Id: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/openssh-CVE-2018-20685.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/ssh.scm (openssh)[source]: Use it. --- gnu/local.mk | 1 + .../patches/openssh-CVE-2018-20685.patch | 44 +++++++++++++++++++ gnu/packages/ssh.scm | 1 + 3 files changed, 46 insertions(+) create mode 100644 gnu/packages/patches/openssh-CVE-2018-20685.patch diff --git a/gnu/local.mk b/gnu/local.mk index 7ee41de64..f3eff831a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1044,6 +1044,7 @@ dist_patch_DATA = \ %D%/packages/patches/openldap-CVE-2017-9287.patch \ %D%/packages/patches/openocd-nrf52.patch \ %D%/packages/patches/opensmtpd-fix-crash.patch \ + %D%/packages/patches/openssh-CVE-2018-20685.patch \ %D%/packages/patches/openssl-runpath.patch \ %D%/packages/patches/openssl-1.1-c-rehash-in.patch \ %D%/packages/patches/openssl-c-rehash-in.patch \ diff --git a/gnu/packages/patches/openssh-CVE-2018-20685.patch b/gnu/packages/patches/openssh-CVE-2018-20685.patch new file mode 100644 index 000000000..463c08a9d --- /dev/null +++ b/gnu/packages/patches/openssh-CVE-2018-20685.patch @@ -0,0 +1,44 @@ +Fix CVE-2018-20685: + +https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-20685 + +Patch copied from upstream source repository: + +https://github.com/openssh/openssh-portable/commit/6010c0303a422a9c5fa8860c061bf7105eb7f8b2 + +From 6010c0303a422a9c5fa8860c061bf7105eb7f8b2 Mon Sep 17 00:00:00 2001 +From: "djm@openbsd.org" +Date: Fri, 16 Nov 2018 03:03:10 +0000 +Subject: [PATCH] upstream: disallow empty incoming filename or ones that refer + to the + +current directory; based on report/patch from Harry Sintonen + +OpenBSD-Commit-ID: f27651b30eaee2df49540ab68d030865c04f6de9 +--- + scp.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/scp.c b/scp.c +index 60682c68..4f3fdcd3 100644 +--- a/scp.c ++++ b/scp.c +#@@ -1,4 +1,4 @@ +#-/* $OpenBSD: scp.c,v 1.197 2018/06/01 04:31:48 dtucker Exp $ */ +#+/* $OpenBSD: scp.c,v 1.198 2018/11/16 03:03:10 djm Exp $ */ +# /* +# * scp - secure remote copy. This is basically patched BSD rcp which +# * uses ssh to do the data transfer (instead of using rcmd). +@@ -1106,7 +1106,8 @@ sink(int argc, char **argv) + SCREWUP("size out of range"); + size = (off_t)ull; + +- if ((strchr(cp, '/') != NULL) || (strcmp(cp, "..") == 0)) { ++ if (*cp == '\0' || strchr(cp, '/') != NULL || ++ strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) { + run_err("error: unexpected filename: %s", cp); + exit(1); + } +-- +2.20.1 + diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm index 88230c505..78659fbbf 100644 --- a/gnu/packages/ssh.scm +++ b/gnu/packages/ssh.scm @@ -149,6 +149,7 @@ a server that supports the SSH-2 protocol.") (method url-fetch) (uri (string-append "mirror://openbsd/OpenSSH/portable/" name "-" version ".tar.gz")) + (patches (search-patches "openssh-CVE-2018-20685.patch")) (sha256 (base32 "1b8sy6v0b8v4ggmknwcqx3y1rjcpsll0f1f8f4vyv11x4ni3njvb"))))