From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#19479: Package manager vulnerable Date: Mon, 07 Sep 2020 19:54:20 -0400 Message-ID: <86o8mh5ej7.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3621"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt) Cc: 19479@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 08 01:55:09 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFQyb-0000pB-HA for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 08 Sep 2020 01:55:09 +0200 Original-Received: from localhost ([::1]:38844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFQya-0001j5-4c for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 07 Sep 2020 19:55:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFQyU-0001ik-7p for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2020 19:55:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFQyT-0001uh-TE for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2020 19:55:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kFQyT-00068U-RH for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2020 19:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Sep 2020 23:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19479 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: security Original-Received: via spool by 19479-submit@debbugs.gnu.org id=B19479.159952287023545 (code B ref 19479); Mon, 07 Sep 2020 23:55:01 +0000 Original-Received: (at 19479) by debbugs.gnu.org; 7 Sep 2020 23:54:30 +0000 Original-Received: from localhost ([127.0.0.1]:51391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFQxy-00067g-1Q for submit@debbugs.gnu.org; Mon, 07 Sep 2020 19:54:30 -0400 Original-Received: from mail-il1-f176.google.com ([209.85.166.176]:44682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFQxv-00067T-Pj for 19479@debbugs.gnu.org; Mon, 07 Sep 2020 19:54:28 -0400 Original-Received: by mail-il1-f176.google.com with SMTP id h11so13674977ilj.11 for <19479@debbugs.gnu.org>; Mon, 07 Sep 2020 16:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=AsLPkR3A5QQnPYciS55P8iLxUjXFlVDQ7ZFKEodEKug=; b=oQLkw846hptnDLe/y+qvb7FPbZUh2xaSwdd2Gb2Nu0qBd/Cn4PkEzJcMHnbfK0ffe1 BVkcE/liP8qvcKbOBtE2ULR1Bl6j4O4ZNhD5qmp45qKuyWYnJ7FUoIsUWbIQg+my6GdO G6fmOk7zq2bDrXLpUsAVgXbbR3CgJ7Qqxp73vTTisEfBex9OaRdY2xSLp1OY2PIjmYb/ zPUHVcDv1+hgC2pGpsLcqxbboNa+nAYK4DO/gNfX00UQT3s18XWnaV3Ftkt+Xm92pnlr PQgSw9Qbu6PE4OsR8MLCqcm5MipNxnXTcR4jZEbbUKDEgYrBp213+Tcw4tdk4SL4WmgH LlTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=AsLPkR3A5QQnPYciS55P8iLxUjXFlVDQ7ZFKEodEKug=; b=b1fiy9H+WYeU7vG4jUrTrWpVZiUou7NT1GQT7LNJiqDFDaSUwl0Ij4EHhVQ15xlb13 o6j5XEE1vP4tmmY2wxXQR0LPqyo3FsE8UTTBSXCvMLyg8RRTRIEeTWvq6l31uJHvJbWy RU7l/tAf+/hfXnaboNQ5fTCAtNqbP5Ve+dSVqUKADJc1UJryAOs6mruveTc3MzFrB3GD Tz8LLWKFSscxnt0/Ij5drJOJyCMBQHgHJHjaSg13B002uHvP3P99Ic4BKAoJ87T2kYiL n9FAedua1VvEuAj6PglTfeQduIvPaB5eBLaR+zCJSabV9xdMPZawpQK+kN/UIv/P5noQ /YSg== X-Gm-Message-State: AOAM530SJg4NPDSkLYYvj1BqmEagFzbpGsrvOxKCxpmDy1rxY90KL5jD QpzAcwOECtyrKW7a1qeV9ix+h2LqyIXfxg== X-Google-Smtp-Source: ABdhPJxh2MTEGBJmqW8HcM5IJ+OEmqB68BLW6EeUBz0mwRv5/A1fqM7ZDqGFc1RzHzXQ9TgiOVWdXg== X-Received: by 2002:a92:9f1d:: with SMTP id u29mr20683022ili.20.1599522861852; Mon, 07 Sep 2020 16:54:21 -0700 (PDT) Original-Received: from LAPTOP-5NDQIUP9 (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id p3sm9186958ilq.59.2020.09.07.16.54.21 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Sep 2020 16:54:21 -0700 (PDT) In-Reply-To: (Stefan Kangas's message of "Mon, 7 Sep 2020 10:19:13 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:187497 Archived-At: Stefan Kangas writes: > >> One more feature: include in each version of archive-contents a hash [...] > Does anyone understand how this would improve security in our case? > AFAIU, it can help with APT since they support distributing package > metadata in several files. ELPA uses only one file, so I'm not sure it > would make much of a difference? Not entirely, but there's a bit more detail on the emacs-devel thread linked from the OP: One final feature that isn't necessary for preventing any of the vulnerabilities above, but still is helpful to make the historical record even more clear, is to include in each version of archive-contents a hash (and length) of the previous version of that file. This further constrains an attacker who has compromised the elpa key; he can still launch attacks, but it's harder to keep the attacks secret for very long, since he's forced to cause a fork in what's supposed to be a linear hash chain. I think the idea is that if the attacker has the signing key and sends out a bad version of archive-contents, it will be revealed as soon as the victim gets a "good" version, since its previous-version hash won't match. Except that only works if the user can expect to get all versions of archive-contents, so maybe I've missed something.