From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4DnEIZMifGDqPgAAgWs5BA (envelope-from ) for ; Sun, 18 Apr 2021 14:14:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id yCR4HZMifGA2eQAAB5/wlQ (envelope-from ) for ; Sun, 18 Apr 2021 12:14:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3B2B915C00 for ; Sun, 18 Apr 2021 14:14:11 +0200 (CEST) Received: from localhost ([::1]:36712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lY6JW-0007os-E3 for larch@yhetil.org; Sun, 18 Apr 2021 08:14:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lY6JP-0007lB-9O for guix-patches@gnu.org; Sun, 18 Apr 2021 08:14:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34085) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lY6JP-0002vT-2A for guix-patches@gnu.org; Sun, 18 Apr 2021 08:14:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lY6JO-0006s1-V7 for guix-patches@gnu.org; Sun, 18 Apr 2021 08:14:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47849] [PATCH 1/1] services: Add a service for the Jami daemon. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 18 Apr 2021 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47849 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer , 47849@debbugs.gnu.org Received: via spool by 47849-submit@debbugs.gnu.org id=B47849.161874801626327 (code B ref 47849); Sun, 18 Apr 2021 12:14:02 +0000 Received: (at 47849) by debbugs.gnu.org; 18 Apr 2021 12:13:36 +0000 Received: from localhost ([127.0.0.1]:45621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lY6Ix-0006qU-JU for submit@debbugs.gnu.org; Sun, 18 Apr 2021 08:13:35 -0400 Received: from albert.telenet-ops.be ([195.130.137.90]:44590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lY6Iv-0006qA-Pd for 47849@debbugs.gnu.org; Sun, 18 Apr 2021 08:13:34 -0400 Received: from butterfly.local ([5.23.206.113]) by albert.telenet-ops.be with bizsmtp id uCDY2400C2TKVvH06CDYBp; Sun, 18 Apr 2021 14:13:33 +0200 Message-ID: <1e9354c0744afc2d5d11d3eeecaba31f62e59e65.camel@telenet.be> From: Maxime Devos In-Reply-To: <20210417200617.18182-1-maxim.cournoyer@gmail.com> References: <20210417200414.18050-1-maxim.cournoyer@gmail.com> <20210417200617.18182-1-maxim.cournoyer@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-jfo/kC9siTqVS/AR+Y8P" Date: Sun, 18 Apr 2021 13:41:06 +0200 MIME-Version: 1.0 User-Agent: Evolution 3.34.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1618748013; bh=EOKzu+va/f3mlV4if7xaIYLNZfAACpMSyxz7fFR7ku0=; h=Subject:From:To:In-Reply-To:References:Date; b=IK2hFvz+pGV5T0Wzyn45jYF/aIhQenepYpsHFf1QgMmGYEszJdUsJmvFT7sA3ibsl GUnRTLbEgm2rqmiDmzuYr9K0NaQJ1YAVUHwFfbDFS2lDVDBiuSxHWUUykEHL5BNFvw FP6jwe9Myi0/imAazqVgSfoDeDfrg64CcseUTafZXk7g1+hsmj/FpJ6glwnOJI2GaO YF+T2/XfcqFYDZ5v30nA/54QIioIpogIcPnWcB2EPzqTOyFhOGSGUM6ziSdzEruOyv 4aCiST2GEpPt0IPD+HfqdFLc+vu2dXqIlmVSS2R2PgfHhdmX5uOmBPqcxgAzj/exJU jXdAvu3E5hKvQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618748051; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=EOKzu+va/f3mlV4if7xaIYLNZfAACpMSyxz7fFR7ku0=; b=MSKF6HuO/4oMvXsCPlOjhF8L2Kt8BiAjju2Rf/9jFl5Tyj+H6jqRjoiJGgjK5df6yFSgN2 f3RWQuNpYdZEtnQdBZadZkcAGqHvO7JaAiKbsaUaoyTG/RWB3wNbpToT7Mf31Pp1Tsf3pG 8duFtbOfvCh/RidSifT02G0HXJerO9gzyVarIW4zFIxANKTtScaX05p+VWPpSs4Xkq1hw3 6OUiiYqX8bFO1j43lU853Rr0DEGSh/QBKke/4w3/MhSz4kVuln6jnhMxixHH0lwzMvo2Zk acU99nAHlD2nC3w5xRXldYcD1exW5hFKAMwVIiALgkAAdaxkYWQRZK5sHNkFaA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618748051; a=rsa-sha256; cv=none; b=JYlxjVQicSdz2Dyhh5yBWoBf/JoD5Zz2gG7CgRHZ0KXqsLrruX6bFN1cUWBCoKqNhaOlwy +vd99r3RDi4GE2KvMgk3fyEHCMTbl6P3qMCh0ZR3r3m693HZR9YP+yKYbKfTfQnoTfc5+6 ytc7LIcXjxOYyPnmdV1CL9WqAP4Z8qMMEN95HjeaypH2V0+PoCmlHWFhW/EOBSH12OxpB1 qLYyYp505T5KN2oZZ7+R3iRPUGq/PqTetULK2nD81H+fxfD2nEDLOA/Q7lZri6QmQ2WnM9 32S9ovSYbU93Brb+Xu0OB2h0kN8eFMNYxoIG99cQjGLH+THTD2cq1eG8Hxi1vQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=IK2hFvz+; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.44 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=IK2hFvz+; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 3B2B915C00 X-Spam-Score: -3.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: Gy/8+ib58T2h --=-jfo/kC9siTqVS/AR+Y8P Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Maxim Cournoyer schreef op za 17-04-2021 om 16:06 [-0400]: + (delete-file-recursively "/var/lib/jami/.cache/jami"= ) + (delete-file-recursively "/var/lib/jami/.config/jami= ") + (delete-file-recursively "/var/lib/jami/.local/share= /jami") + (delete-file-recursively "/var/lib/jami/accounts")) You might want to verify whether /var/lib/jami/{.cache,.config,.local/share= ,.local} aren't symbolic links. That way, if the Jami daemon is compromised (due to= buffer overflow --> arbitrary code execution or something), the attacker can't tri= ck the shepherd service into deleting arbitrary directories. This attack is _not_ blocked by fs.protected_symlinks. From the sysctl doc= umentation: When set to "1" symlinks are permitted to be followed only when outside a sticky world-writable directory, or [...] /var/lib/jami is not world-writable (I'd hope). Example scenario: * the jami daemon has a security bug that allows arbitrary code execution within the daemon * the attacker exploits this * now the attacker can modify everything under /var/lib/jami * the attacker deletes /var/lib/jami/.config and replaces it with a symli= nk to /home/ANY-USER/.config * eventually, the system reboots * (delete-file-recursively "/var/lib/jami/.config/jami") is run. As "/var/lib/jami/.config" points to "/home/ANY-USER/.config", this means "/home/ANY-USER/.config/jami" is deleted. * thus, ANY-USER loses their jami configuration Does that makes sense to you? Greetings, Maxime. --=-jfo/kC9siTqVS/AR+Y8P Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYHwayxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7qSCAQDJFxwHTTtk3NefZrfxoYn7wiXU bKKWE4wsy018Jz0yPAD/c/j0Ag79AkvEljYjkUgJSS4QjNo7MRPHVgK0cUSR7wE= =pUai -----END PGP SIGNATURE----- --=-jfo/kC9siTqVS/AR+Y8P--