From patchwork Mon May 17 19:00:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 4301 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FkT3M1THYz3wbb for ; Mon, 17 May 2021 19:00:15 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FkT3K5d1tz1TQ; Mon, 17 May 2021 19:00:13 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FkT3K3ZNvz2xd6; Mon, 17 May 2021 19:00:13 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FkT3J1XZPz2xPC for ; Mon, 17 May 2021 19:00:12 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4FkT3H11kzzxV for ; Mon, 17 May 2021 19:00:10 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1621278012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2KrRSU8bUDRZ88n1jQlwZgIQkfNADVcXuJ3z1wN+SYg=; b=Q1mahnnF1jmZcDKty0aFU/ops5hY1KG15xbyPvfgZxZqwj6WL3igXubbCgR7cR6qNn5zbL vKIi12SjPL87AaBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1621278012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2KrRSU8bUDRZ88n1jQlwZgIQkfNADVcXuJ3z1wN+SYg=; b=GUV9KuPdiVhIMQIVVaj64Cc+beC0nMN7VWZrOHRm2xq3FIGIZ6OThbc66d8G4bJKdDfSvc BCQk8eTiVKpj7ZyCISZ5UrArcz0iSJ/1gMECNSlNEoAXKoDYXVrnOGwjeg7EbWbk2lzNVe zDBon5f1l4Ag7N7GM85efi6UFmY6sSJ1cTWiS+EO4vmCZRVTC2pNVyEFt4n3rjUklINcXI 3s/J2oT07N8dAwho6E+3rzBgDkvRhJddvW0ll3EcOXVUJyTAgbbhOb/JQClxT4QGBHTseo I1rCL/ZCxi9QPOd9nR2bo74/LcTCeL55YW4oauCOP6ywHsobzeKFQ4lvi4U7ig== To: "IPFire: Development" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH 00/20] Prevent "nobody" from escalating privileges by using writeable binaries as a vehicle Message-ID: Date: Mon, 17 May 2021 21:00:07 +0200 MIME-Version: 1.0 Content-Language: en-US X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" This patchset restricts dangerous file permissions, either SUID binaries or executable binaries within /var/ipfire/ owned by "nobody", to their absolute need-to-work basis. Hereby, we make privilege escalation attempts carried out by "nobody" against IPFire-specific files harder, as there is no direct vehicle to write in arbitrary shell code which is then executed later on. Partially fixes: #12619 Peter Müller (20): GnuPG does not need to have a SUID bit set Core Update 157: remove SUID bit from /usr/bin/gpg /usr/bin/ping does not need a SUID bit if appropriate capabilities are set Core Update 157: Delete ssh-keysign binary DMA: do not ship a binary for creating mail boxes Core Update 157: Delete orphaned DMA mail box creation binary as well Core Update 157: /var/ipfire/fwhosts/icmp-types does not have to be executable Core Update 157: Ship changed iputils due to /usr/bin/ping changes backup: prevent /var/ipfire/backup/bin/backup.pl from being owned by nobody SquidGuard: Prevent binaries within /var/ipfire/urlfilter/bin/ from being owned by nobody Core Update 157: Apply changed permissions to /var/ipfire/urlfilter/bin/ Squid: Prevent binaries within /var/ipfire/updatexlrator/bin/ from being owned by nobody Core Update 157: Apply changed permissions to /var/ipfire/updatexlrator/bin/ OpenVPN: ovpn-leases.db for sure does not have to be executable Core Update 157: Apply changed permissions to /var/ipfire/ovpn/ovpn-leases.db Core Update 157: Remove executable bit less ugly NRPE: Prevent NRPE binary from being owned by "nobody" nagios-plugins: Prevent Nagios plugins from being owned by nobody Squid: cachemgr.cgi does not have to be owned (hence writeable) by nobody Core Update 157: Apply changed permissions to /srv/web/ipfire/cgi-bin/cachemgr.cgi config/rootfiles/common/dma | 2 +- config/rootfiles/core/157/filelists/iputils | 1 + config/rootfiles/core/157/update.sh | 18 ++++++++++++++++++ lfs/backup | 7 ++++--- lfs/gnupg | 4 ++-- lfs/iputils | 7 +++++-- lfs/nagios-plugins | 8 ++++++-- lfs/nagios_nrpe | 7 +++++-- lfs/openvpn | 4 ++-- lfs/squid | 5 +++-- lfs/squidguard | 3 ++- 11 files changed, 49 insertions(+), 17 deletions(-) create mode 120000 config/rootfiles/core/157/filelists/iputils