Re: [OAUTH-WG] Signed JWK Sets

Ethan Heilman <eth3rs@gmail.com> Fri, 12 April 2024 02:16 UTC

Return-Path: <eth3rs@gmail.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 85DAEC14F713 for <oauth@ietfa.amsl.com>; Thu, 11 Apr 2024 19:16:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.094
X-Spam-Level:
X-Spam-Status: No, score=-2.094 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Vqp6nacX_lA4 for <oauth@ietfa.amsl.com>; Thu, 11 Apr 2024 19:16:20 -0700 (PDT)
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AE6E9C14F711 for <oauth@ietf.org>; Thu, 11 Apr 2024 19:16:20 -0700 (PDT)
Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-516d4d80d00so584429e87.0 for <oauth@ietf.org>; Thu, 11 Apr 2024 19:16:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712888178; x=1713492978; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=D7nANZgIVVEuSzXQUCshHZbtsYPqiOi44tULyJdoGiw=; b=iTYqeXu5RO1TgDf38/xJWomBDtv5+mhRC0qAoXAa0RM4Oza2gD9Kpob2m+CiLB7Dke 1brri2rhjXGPb7PD101o3ELlMi35qenrW8l0HhSXZgz1vg2aA1gr/YnEEbRfxHQoPDGF C4eLSVSEIQhv/J3fR+JqiQylqOgTUqk7Zhm2DfHdmFop6JsfOdUnXxHLqmozQWFbmDZH /6iqfM9QNRPkvaVhhMYP1ETtxodb9qlffYvBvIJQYFFzuiR0VK2tWHH9RwMijAV89IWn 3/x/3nArN3PDpMEZmtrjXsifxPv5bjyxnPHGCrGCcvo09dmHl+al9qOPs/lnn9sk2UvO qj8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712888178; x=1713492978; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=D7nANZgIVVEuSzXQUCshHZbtsYPqiOi44tULyJdoGiw=; b=S06fjVGtSVMqLzr1vNmUykG+eiD7V92/r8MB5MnO7jGOXNQnNxapGobtRPTHkgqebJ 7jfnOw55cogfMG54cWbMwuy00jcvJ94/owSJlEV4SWIjaztd2bUan5TogXbTbX4iO67T BgNYQnWFfn/6aXqac068g6nBUT7xrnQY5JgcLdezpBq0iXdDTOhApGAoEp9y/Aepnn2l cpU+FZ+oGO08Ju60jeXtWOpOE2uGiaZOpgCWN4jFWj6BF1UiB8BWw8Qqwhql/ULYIDyU 1OM2HpCRnaCF3HWd/WLBgtBuNjWasl+uYfL/WbRDfD/IfbeuGftLjXTEPnI4epvw8n3E yJ6A==
X-Gm-Message-State: AOJu0YxP88EaGsl4jrzD52Qny/5357c4P7oSRPSWI28G79NwVtgAZINY L6Ii62gmksFtBGYVJAJ1DANsm/FRCCI6asEEQo25DBYAg6JspQbg1rwWNE7Wg0LKrdwNazf0DWg 75sdlwZ5Q5xZ8rvT/Eou60F5BEKI=
X-Google-Smtp-Source: AGHT+IHNcM6ZP6Ky5ktJ1bafyC6fmtCIzn7XSgM8jMis5hw+A5BqAWOO3c6fK7iUG5jGrgS/9k7WvQZunngD4kzxSMY=
X-Received: by 2002:a05:6512:1392:b0:516:a923:542c with SMTP id fc18-20020a056512139200b00516a923542cmr1057882lfb.11.1712888177568; Thu, 11 Apr 2024 19:16:17 -0700 (PDT)
MIME-Version: 1.0
References: <CAL02cgSANrR=nys3RXDOYJPibLkv25X8Okq4dhL0Dpfi_ZSS_A@mail.gmail.com> <CAL02cgQG4Fhn2zCmq0EFLJReB_jf257msdM9OEgYr03n6D1qRg@mail.gmail.com> <CAEM=y+WEgqLa7+0jreqHTK2UjueEWU+hJ05peuO6wSzyQ4WN=Q@mail.gmail.com> <7D922D5F-5277-4884-820E-35DC3E02FCB3@gmail.com>
In-Reply-To: <7D922D5F-5277-4884-820E-35DC3E02FCB3@gmail.com>
From: Ethan Heilman <eth3rs@gmail.com>
Date: Thu, 11 Apr 2024 22:15:40 -0400
Message-ID: <CAEM=y+VkFksRsH9WYBq2yZu7HR5GCFEgT98tLmrs_PgF_+tHow@mail.gmail.com>
To: Neil Madden <neil.e.madden@gmail.com>
Cc: OAuth WG <oauth@ietf.org>, Sharon Goldberg <goldbe@bastionzero.com>
Content-Type: multipart/alternative; boundary="0000000000005d34600615dcdb97"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/k92T5774WL_cKuGuxvdZ7k5Juek>
Subject: Re: [OAUTH-WG] Signed JWK Sets
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/oauth/>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 12 Apr 2024 02:16:24 -0000

Hi Neil,

I agree that PIKA would not protect against an attacker compromising a JWKS
URI via a mis-issued TLS cert.

I was thinking of a simpler attack where the attacker compromises the
server where a JWKS URI is hosted or the JWKS is stored. For instance
consider an JWKS which is read from a database. An attacker could use a SQL
injection to add their own key to the JWKS. Because such an attacker does
not compromise any TLS certificates PIKA would defeat this attack (assuming
the verifier required PIKA for that JWT issuer).

Today, write access to a JWKS is sufficient to comprise the signing
authority of a JWT issuer. With PIKA write access to a JWKS may not be
sufficient to compromise the signing authority of a JWT issuer.

Thanks,
Ethan


On Thu, Apr 11, 2024 at 5:15 PM Neil Madden <neil.e.madden@gmail.com> wrote:

> On 11 Apr 2024, at 01:12, Ethan Heilman <eth3rs@gmail.com> wrote:
>
>
> I want to voice my support for this draft: Proof of Issuer Key Authority
> (PIKA). The ability to reason about the past validity of JWKS is extremely
> useful for using OIDC in signing CI artifacts and e2e encrypted
> messaging.This includes what we are building at OpenPubkey (
> github.com/openpubkey/openpubkey) and also proposed security improvements
> to software supply chain systems like SigStore (
> https://arxiv.org/pdf/2307.08201.pdf).
>
> I want to underscore the value of PIKA to increase the security of JWKS
> URIs and OpenID Connect. Currently if an attacker compromises an OpenID
> Provider's JWKS URI the attackers can substitute their own public keys and
> impersonate any user to any relying parties who depend that OpenID
> Provider. The effects of Google, Microsoft or Okta's JWKS URI being
> controlled by a malicious party for even a few minutes could be
> devastating. The widespread deployment of PIKA would remove this risk and
> require that attackers compromise not only the JWKS URI but also the PIKA
> signing keys.
>
>
> I'm still digesting this draft, and generally supportive of it. However, I
> don't think it stops the attack you mention here, which sounds similar to
> threats that Ryan Sleevi discussed for FastFed in [1]. Essentially, in the
> current OIDC model, an attacker that briefly compromises the jwks_uri of an
> OP (e.g. through a mis-issued TLS cert) can serve a JWK Set containing
> public keys under their own control with a long Cache-Control header.
> Clients then might blindly cache that key set even beyond the time when the
> certificate is revoked and the rightful owner restored.
>
> But I think this attack is basically the same even with PIKA. The attacker
> in this case just uses their mis-issued cert to sign the PIKA and serve
> that instead, perhaps putting a really long "exp" claim in it so that
> clients cache it for a really long time. The only thing that would stop
> that is if the draft insisted that clients regularly perform an OCSP or CRL
> lookup on the cert in the x5c chain to make sure it hasn't been revoked.
> But that would completely negate the benefits of avoiding clients all
> hitting the OP jwks_uri: we've just shifted the burden from the OP to the
> CA.
>
> Perhaps I'm missing something?
>
> [1]:
> https://docs.google.com/document/u/1/d/e/2PACX-1vQQ-FhNjW0ZhZVTnK1VG_87IBNZKBaJmweYZb1VBRdQCMAWXekqKfxdNl8wL6FWFDJ9pxXxpr66-GZp/pub?utm_source=illuminatedsecurity&utm_medium=email
>
>
> -- Neil
>