[00/20] Prevent "nobody" from escalating privileges by using writeable binaries as a vehicle
| Message ID | d4dd10c2-c0d1-42e3-3eda-ba61067717a5@ipfire.org | 
|---|---|
| Headers | Return-Path: <development-bounces@lists.ipfire.org> 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 <patchwork@web04.haj.ipfire.org>; 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 <development@lists.ipfire.org>; 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 <development@lists.ipfire.org>; 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" <development@lists.ipfire.org> From: =?utf-8?q?Peter_M=C3=BCller?= <peter.mueller@ipfire.org> Subject: [PATCH 00/20] Prevent "nobody" from escalating privileges by using writeable binaries as a vehicle Message-ID: <d4dd10c2-c0d1-42e3-3eda-ba61067717a5@ipfire.org> Date: Mon, 17 May 2021 21:00:07 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <https://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <https://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> | 
Message
    Peter Müller
    17 May 2021, 7 p.m. UTC
  
  
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