From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id MOXyGradUmBzFwAA0tVLHw (envelope-from ) for ; Thu, 18 Mar 2021 00:24:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id QGm9FradUmCAYwAA1q6Kng (envelope-from ) for ; Thu, 18 Mar 2021 00:24:22 +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 B3AE82D2D0 for ; Thu, 18 Mar 2021 01:24:21 +0100 (CET) Received: from localhost ([::1]:39878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMgSa-0003m9-FF for larch@yhetil.org; Wed, 17 Mar 2021 20:24:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMgSO-0003km-AS for bug-guix@gnu.org; Wed, 17 Mar 2021 20:24:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:32889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMgSI-0000Qj-3J for bug-guix@gnu.org; Wed, 17 Mar 2021 20:24:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lMgSH-0002p1-UW for bug-guix@gnu.org; Wed, 17 Mar 2021 20:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#47222: Serious bug in Nettle's ecdsa_verify Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 18 Mar 2021 00:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47222 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 47222@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161602703110826 (code B ref -1); Thu, 18 Mar 2021 00:24:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Mar 2021 00:23:51 +0000 Received: from localhost ([127.0.0.1]:44435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMgS7-0002oY-5o for submit@debbugs.gnu.org; Wed, 17 Mar 2021 20:23:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:41454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMgS4-0002oP-6D for submit@debbugs.gnu.org; Wed, 17 Mar 2021 20:23:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMgS4-0003jR-04 for bug-guix@gnu.org; Wed, 17 Mar 2021 20:23:48 -0400 Received: from world.peace.net ([64.112.178.59]:36592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMgRw-0000AY-R7 for bug-guix@gnu.org; Wed, 17 Mar 2021 20:23:47 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMgRk-0005tF-Cm; Wed, 17 Mar 2021 20:23:28 -0400 From: Mark H Weaver References: Date: Wed, 17 Mar 2021 20:21:54 -0400 Message-ID: <87blbhia4i.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=64.112.178.59; envelope-from=mhw@netris.org; helo=world.peace.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616027061; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=NZs7yQhcNqDyOHP4+gA+qtaThDRi43cU5+Y7DZj6t90=; b=K8gf6XB0lpfKNQ7f1sp2/FXWPGnOHlUZX2JdY4tA77dehHhYE+UUxIW/ywuTZZeVNNyiCN HyYi66kKxfdBNR8dOgTdDqWmB3s9Tzg//ZMehozKpxYuYbqkNfxSncST+B3BAGzSDFqfAg AtDwib03fBoMYV7/Yj2eDKARsosF+y2jU3XmXyzcjGKFCx8iDffqGcuv31hsz4IxoUU50+ WDpkJO9h4FU7K5ef+b8AUOw+EPpm6jPqskbg66sglve2oNnGnmSok7oYvVcIGx3ZYgsYVC 2eqcQUV7V9EKRIlJi+ePNFPmZR7atfIGFL4RGCqiSxUBBUpNhOWjNuvF8royLQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616027061; a=rsa-sha256; cv=none; b=WjCuqQmG3rtL62QnW0AZNBAWu2kmKzr72A9Mq8qhbGah+8LdTe/WTEYFp6NmM4RILwPjnx VcxmA0Kd2IT0os/UXOVPcr3w7yqp15znx3A4xJAdo/nAk9hONbgCk0o9eTLrJJhvPu0FxT irIxTlwnDQO24S4DMsiAHbdyN6uLASO4XFtflym88mqRt1908PCVM/hdLHJJDWkP9qwc6/ IJvm1ocaxS+nzvqYWQdtt+dShzUG0wvFz0Y4o6dMY+YTXX5Z3M5C4MfeOeT5pcdA4Ox0wl hL7j0IcN1AEJgjmd6lDfeL0Jq9lDeoYRsNv0uf4maZqWkegP2vADk/OhiW9r6w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -2.40 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: B3AE82D2D0 X-Spam-Score: -2.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: EaJ4Dk20DPQv FYI... -------------------- Start of forwarded message -------------------- From: nisse@lysator.liu.se (Niels M=C3=B6ller) To: nettle-bugs@lists.lysator.liu.se Subject: ANNOUNCE: Serious bug in Nettle's ecdsa_verify Date: Tue, 16 Mar 2021 09:07:56 +0100 I've been made aware of a bug in Nettle's code to verify ECDSA signatures. Certain signatures result in the ecc point multiply function being called with out-of-range scalars, which may give incorrect results, or crash in an assertion failure. It's an old bug, probably since Nettle's initial implementation of ECDSA. I've just pushed fixes for ecdsa_verify, as well as a few other cases of potentially out-of-range scalars, to the master-updates branch. I haven't fully analysed the implications, but I'll describe my current understanding. I think an assertion failure, useful for a denial-of-service attack, is easy on the curves where the bitsize of q, the group order, is not an integral number of words. That's secp224r1, on 64-bit platforms, and secp521r1. Even when it's not possible to trigger an assertion failure, it's easy to produce valid-looking input "signatures" that hit out-of range intermediate scalar values where point multiplication may misbehave. This applies to all the NIST secp* curves as well as the GOST curves. To me, it looks very difficult to make it misbehave in such a way that ecdsa_verify will think an invalid signature is valid, but it might be possible; further analysis is needed. I will not be able to analyze it properly now, if anyone else would like to look into it, I can provide a bit more background. ed25519 and ed448 may be affected too, but it appears a bit harder to find inputs that hit out of range values. And since point operations are inherently more robust on these curves, I think they will produce correct results as long as they don't hit the assert. Advise on how to deal best with this? My current plan is to prepare a 3.7.2 bugfix release (from a new bugfix-only branch, without the new arm64 code). Maybe as soon as tomorrow (Wednesday, european time), or in the weekend. Regards, /Niels --=20 Niels M=C3=B6ller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. _______________________________________________ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs -------------------- End of forwarded message --------------------