From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/1] gnu: libupnp: Fix CVE-2016-6255. Date: Thu, 06 Oct 2016 21:28:34 +0200 Message-ID: <8760p5jmzh.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsELU-0002uI-7y for guix-devel@gnu.org; Thu, 06 Oct 2016 15:28:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsELP-0007DP-GW for guix-devel@gnu.org; Thu, 06 Oct 2016 15:28:43 -0400 In-Reply-To: (Leo Famulari's message of "Thu, 6 Oct 2016 02:16:27 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Leo Famulari Cc: guix-devel@gnu.org Leo Famulari skribis: > * gnu/packages/patches/libupnp-CVE-2016-6255.patch: New file. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/libupnp.scm (libupnp): Use it. [...] > +From d64d6a44906b5aa5306bdf1708531d698654dda5 Mon Sep 17 00:00:00 2001 > +From: Matthew Garrett > +Date: Tue, 23 Feb 2016 13:53:20 -0800 > +Subject: [PATCH] Don't allow unhandled POSTs to write to the filesystem = by > + default > + > +If there's no registered handler for a POST request, the default behavio= ur > +is to write it to the filesystem. Several million deployed devices appear > +to have this behaviour, making it possible to (at least) store arbitrary > +data on them. Add a configure option that enables this behaviour, and ch= ange > +the default to just drop POSTs that aren't directly handled. Fun. :-) > +diff --git a/configure.ac b/configure.ac > +index 9548913..a8731b5 100644 > +--- a/configure.ac > ++++ b/configure.ac Shouldn=E2=80=99t it require an autoreconf phase? I would suggest shrinking this patch to just: > +--- a/upnp/src/genlib/net/http/webserver.c > ++++ b/upnp/src/genlib/net/http/webserver.c > +@@ -1367,9 +1367,13 @@ static int http_RecvPostMessage( > + if (Fp =3D=3D NULL) > + return HTTP_INTERNAL_SERVER_ERROR; > + } else { > ++#ifdef UPNP_ENABLE_POST_WRITE > + Fp =3D fopen(filename, "wb"); > + if (Fp =3D=3D NULL) > + return HTTP_UNAUTHORIZED; > ++#else > ++ return HTTP_NOT_FOUND; > ++#endif =E2=80=A6 with =E2=80=9C#if 0=E2=80=9D instead of =E2=80=9C#ifdef UPNP_ENAB= LE_POST_WRITE=E2=80=9D. WDYT? Feel free to commit adjusted as you see fit! Thanks, Ludo=E2=80=99.