Re: [jose] Preventing invalid curve attacks at EC JWK construction / parse time

Nathaniel McCallum <npmccallum@redhat.com> Wed, 19 April 2017 11:57 UTC

Return-Path: <nmccallu@redhat.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 148E41294C7 for <jose@ietfa.amsl.com>; Wed, 19 Apr 2017 04:57:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HK_RANDOM_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WGxAPh9k8FC2 for <jose@ietfa.amsl.com>; Wed, 19 Apr 2017 04:57:45 -0700 (PDT)
Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 574D11294E7 for <jose@ietf.org>; Wed, 19 Apr 2017 04:57:45 -0700 (PDT)
Received: by mail-io0-f182.google.com with SMTP id k87so19189875ioi.0 for <jose@ietf.org>; Wed, 19 Apr 2017 04:57:45 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rv4/emren+l/uHOjhTU6Bc2NonkQp/K0BY9uFSCO0T4=; b=J1qDDlGv9xJ4fgX4V4dsfOP0wFaZXlKsHHishc1q3HtaYbIwOoArWANSus0KWsKCHf nLhpFXhmacJSyajwJNXHELLN1oHBvfHiLds12PBIvkHydAQu3dxyUx55uVjfJUlAklRK ByoHJVVUGiBmCMZ5iDzsoQP9r9pvAJOhOlWpJFkY+IonOL499lSzg2ZgRjjJNbZBS5c7 Go9bxM0tjhRxi7qxQMZ+qtvkEgIBkedIB9A7nsTrxxX+uvgw45CAmYKhkDP12LlAdE2J Psq2sn0/mNjph6o8kaovX3M8kdnvMCkjYYuNYupKISOpjgwGUKq4kO5slGCO5n8pwhWE hpZQ==
X-Gm-Message-State: AN3rC/4xs+RCUN8Dc3DIELpWxVimQmsJTAmbHz8ZooIXSCNLqSxpfUrL s9H9rtiRyXLFH8mKo+6jmdxMYpumXnYbVjU=
X-Received: by 10.107.146.139 with SMTP id u133mr2896204iod.160.1492603064537; Wed, 19 Apr 2017 04:57:44 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.107.2.66 with HTTP; Wed, 19 Apr 2017 04:57:44 -0700 (PDT)
In-Reply-To: <ad430c4f-a0f0-1d20-fafa-bdb4ca573193@connect2id.com>
References: <ad430c4f-a0f0-1d20-fafa-bdb4ca573193@connect2id.com>
From: Nathaniel McCallum <npmccallum@redhat.com>
Date: Wed, 19 Apr 2017 07:57:44 -0400
Message-ID: <CAOASepNquKnHSYQg6+twPdWdjhQ=CMom0PXYCJu41ViVGQ6Q9g@mail.gmail.com>
To: Vladimir Dzhuvinov <vladimir@connect2id.com>
Cc: "jose@ietf.org" <jose@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/NwEosirVUk6NwQQ9tEHNHDVpGJs>
Subject: Re: [jose] Preventing invalid curve attacks at EC JWK construction / parse time
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 19 Apr 2017 11:57:47 -0000

http://github.com/latchset/jose does exactly this. I also recommend
other implementations do the same.

On Wed, Apr 19, 2017 at 5:43 AM, Vladimir Dzhuvinov
<vladimir@connect2id.com> wrote:
> JOSE lib maintainers could consider adding a curve check at EC JWK
> construction / parse time. This will stop an invalid curve attack early
> in its tracks, when the JWE message is being parsed, so the invalid EC
> JWK will not even reach the ECDH-ES decryption phase.
>
> This extra validation is now included in Nimbus JOSE+JWT v4.36. I
> suppose it could also prevent other issues with having invalid EC JWK
> around an app.
>
> Cheers,
>
> Vladimir
>
>
>
>
> _______________________________________________
> jose mailing list
> jose@ietf.org
> https://www.ietf.org/mailman/listinfo/jose
>