Re: [Ohai] DoubleCheck and CONNECT-UDP

Ben Schwartz <bemasc@google.com> Wed, 27 July 2022 23:35 UTC

Return-Path: <bemasc@google.com>
X-Original-To: ohai@ietfa.amsl.com
Delivered-To: ohai@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 90963C136330 for <ohai@ietfa.amsl.com>; Wed, 27 Jul 2022 16:35:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -17.608
X-Spam-Level:
X-Spam-Status: No, score=-17.608 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.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 7xlg6jWVLO_p for <ohai@ietfa.amsl.com>; Wed, 27 Jul 2022 16:35:56 -0700 (PDT)
Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 95DE3C13CCE4 for <ohai@ietf.org>; Wed, 27 Jul 2022 16:35:56 -0700 (PDT)
Received: by mail-io1-xd36.google.com with SMTP id z132so324155iof.0 for <ohai@ietf.org>; Wed, 27 Jul 2022 16:35:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v2ntkxVdvXIrEcvB1u3R1QsxgXxxwf0UnnN2qtLo4S0=; b=sft78PjrkGODzPzN6EOgjqpuzOA0IMACZWX80+TYRisZc0EqTznVlVq7V0VdDMQRTU WEJMFNSRCIHz7izZZdMtplgoqg2ttCJhhjAK+iO/E3XLXOtLgee8YPBhNqvM/5vZYZBk vt+bqNkSsbkv4L4yith2rTxoJwKGcdH1CgpWXl1GZWWYghRCz0Pm/5uQxK3MjCNh3xvr AO6jXIvoWYmla9TnnlYttjl9EMf4/o3A2mDitB56YZPn51O5bt/v8xQ6s+YiIwFAMkYD wG38LRWL65N4PydXhWUUvSVDXT22J41bzQJXU162i3R6/lSgfOzXYhE5Ioy+m23UqY2o S5AA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=v2ntkxVdvXIrEcvB1u3R1QsxgXxxwf0UnnN2qtLo4S0=; b=eaRZKGfJQ+Y1Gd4sJJGLjepOesbctaTzmoSZmNy9IkpP/J5UdUGDELp5aMGKtvfNSI Qn6BcG9MYdMJFX+31rHlfHDStTFHljE1e0yOpxHawAnKB2mujAxOm53NoSCPaD9Q9XzA EZckkqScH0DMURBB5A1ZWuuSs+XfvlYvP82Gz6bKOq6wwUBqswPLWjmecZI9GJK8rs8K KBYW33tfXqplgKxTx9uI30NdqVIVEadrvjcyGdsL8bHYueMmEMOJu1n9KTDYmazdjzo2 9P3VXqxe/Q4aY9Fw3WRjOrnWFVp/troxiUwudh/7gCD2c9pVGPXCbLhuMLaSLjDKt/QS tZbA==
X-Gm-Message-State: AJIora9MMjzUBj1Nm5+xoX/X4B+m9b4Di7Ou9WERF6zqcQ9ubzETQN9n 7waYiTcygXTl4NYp0BzR30zV+2tTm+dFQFgpMOkbbEz9OizAag==
X-Google-Smtp-Source: AGRyM1tvHKU5GsMD+l5cd3ZXpt5YwUJehSWsPwpnhFnxw1dsVhatIqDcRC9v9K34EtXQiFAPlHpHjAyJXZTpv5GMKtU=
X-Received: by 2002:a05:6638:dd1:b0:341:595e:4ef8 with SMTP id m17-20020a0566380dd100b00341595e4ef8mr9828991jaj.26.1658964955727; Wed, 27 Jul 2022 16:35:55 -0700 (PDT)
MIME-Version: 1.0
References: <20220727040122.bpumth5yamgmlgbb@localhost> <CAPJ=pvS3sOkttASUjcLvXBXxky=Ob903qb92c-jQii0cEKRwoA@mail.gmail.com> <CAPJ=pvTsEj6zX2Tk92jTV88mZpskTL-iHhc+6uq1CEPCPUG+iQ@mail.gmail.com> <CAPJ=pvSfCc3X4+nqwbcuNohO-Z2ZBsf6MGHAyoJjDxcpDqaxdQ@mail.gmail.com> <EF9174FA-7D60-4F80-9C5F-605E2BD70FB4@apple.com>
In-Reply-To: <EF9174FA-7D60-4F80-9C5F-605E2BD70FB4@apple.com>
From: Ben Schwartz <bemasc@google.com>
Date: Wed, 27 Jul 2022 19:35:43 -0400
Message-ID: <CAHbrMsA-EAU9aTce8piHhx2CCyH7Y5BYPxyXstr2ZKGt_MSBWQ@mail.gmail.com>
To: Matthew Finkel <sysrqb=40apple.com@dmarc.ietf.org>
Cc: ohai@ietf.org
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-256"; boundary="000000000000e7e84805e4d1e038"
Archived-At: <https://mailarchive.ietf.org/arch/msg/ohai/RAeY-9kPZ9lM2kGQmYfLZVtTVBk>
Subject: Re: [Ohai] DoubleCheck and CONNECT-UDP
X-BeenThere: ohai@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Oblivious HTTP Application Intermediation <ohai.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ohai>, <mailto:ohai-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ohai/>
List-Post: <mailto:ohai@ietf.org>
List-Help: <mailto:ohai-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ohai>, <mailto:ohai-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Jul 2022 23:35:57 -0000

On Wed, Jul 27, 2022 at 3:42 PM Matthew Finkel <sysrqb=
40apple.com@dmarc.ietf.org> wrote:

> On Tue, Jul 26, 2022 at 10:57:33PM -0400, Ben Schwartz wrote:
> > During my presentation today, I suggested that the DoubleCheck procedure
> might not need CONNECT-UDP if it's acceptable for the Service Description
> Host (SDH), which is presumed to be affiliated with the gateway, to learn
> the pool of client IPs.  On second thought, I believe the CONNECT-UDP
> tunnel is indeed necessary.
> >
> > Without the CONNECT-UDP tunnel, clients would authenticate the KeyConfig
> by fetching it directly from the SDH.   In this arrangement, it is often
> possible for the gateway to identify the precise client IP that issued a
> particular OHTTP request, due to timing correlation.  If the rate of
> queries to this gateway (through this relay) is relatively low (<1 QPS),
> correlation is trivial.  The gateway can constantly rotate its KeyConfig,
> forcing clients to reauthenticate it before each OHTTP request.
> >
> > At higher query rates, other tricks are possible, such as rotating the
> KeyConfig and then slow-walking the authentication responses.  By sending
> authentication responses to each client "one at a time", the SDH and
> Gateway can observe the OHTTP request that follows each authentication
> response.
> >
> > In other words, OHTTP requests are linkable (via timing) to the
> corresponding KeyConfig authentication requests, so these authentication
> requests must not be linkable to anything else.  This means authentication
> requests from all clients on the relay must be indistinguishable, so they
> must all go through a single proxy.
>
> I agree, thanks for thinking through this attack and writing a
> concrete proposal for achieving key consistency and correctness. We
> should probably update the referenced informational KCCS document with
> some of these insights, as well. I also appreciate how this design
> leverages multiple discovery methods.
>
> As for feedback on the draft:
> 1) Is there a specific reason why this depends on the Access Service
> Descriptions? I see why they are useful, but they seem more like a
> convenience than a required dependency, is this true?
>

I would describe it as an important convenience.

This draft uses Access Service Descriptions in two ways:

1. To describe the Target service.  This is important because we need to
apply our consistency rules to three separate pieces of information:
- The Gateway URL
- The KeyConfig
- The Target service (however it is described)

If these aren't described by a single resource, we need to apply the
DoubleCheck procedure independently to each resource.  I think this is
probably possible to do safely, but it seems inefficient.  However, I have
heard arguments for splitting up this information (e.g. adding a layer of
indirection between the Access Description and the KeyConfig), and that may
be an OK solution.

2. To describe the Relay.  This is important because the client needs to be
configured with the Relay/cache, an affiliated transport proxy (e.g.
CONNECT-UDP), and ideally an affiliated DoH server.  I think we can
reasonably ask users to paste one magic URL into a settings field
somewhere, but I don't think we can ask them to copy-paste three magic URLs.

2) The concern described at the end of the introduction around not
> using the same update mechanism for key rotation as the one used for
> configuring the "Service Description" seems like a bit of a stretch.
> First, key rotation should not be occurring at such a high frequency
> that a slower (software release process) update mechanism is
> inadequate.


I'm not sure I agree with this.  Would you rely on the Android OS update
system to rotate a compromised key?  Are you sure your Windows updates take
effect without a reboot?

I agree that the example is artificial.  Perhaps a more compelling example
would be a public ODoH server, represented by a string (e.g. a URL)
copy-pasted from the public documentation into a settings panel.  The
string comes from a trusted source, but there is no live channel to update
it, so it can't contain the KeyConfig.


> Second, as mentioned in the KCCS document, we recommend
> specifying a "minimum validity period" for these keys such that a
> service can't easily partition users based on which key they know/use.
> While we didn't recommend any specific minimum period length, I would
> certainly recommend a lower-bound on the order of days (with typical
> rotation on the order of weeks, at a minimum). Providing more
> flexibility and agility opens more avenues for abuse, but I am
> interested in hearing any trade-offs you thought about for this, too.
>

Counterintuitively (at least to me), I believe DoubleCheck guarantees
authenticity and consistency regardless of validity period.  However,
extremely short validity periods might generate excessive revalidation
overhead.

3) Not directly feedback on this draft, but most obviously, the
> consistency guarantees are only limited to users of the same relay (I
> believe you mentioned this, but I can't find it now), so we may be
> missing "global" consistency (if the service is used via
> multiple/arbitrary relays). As discussed in other contexts, "global
> consistency" really reduces to ensuring each client request originates
> from a sufficiently large client anonymity set. Defining "sufficiently
> large" is likely context and application-specific, but it should be
> explicitly considered in deployments. This is related to "precondition
> (1)", but it is not the same. Do you have thoughts you can share on
> this?
>

I've been assuming that each client only accesses the service via one relay
(at least for an extended period of time).  If that's true, it follows that
the user's anonymity set is already reduced to the number of users on the
relay, and our challenge is to avoid reducing it further.

Spreading requests across multiple distinct relays is an intriguing idea,
but I haven't given it much thought.

4) A possible TODO: Regarding the response by a Service when the
> Service Description changes but a request's If-Match header identifies
> a previous version of the resource: Should the Service cache old
> versions for a certain time? Maybe something like an additional
> max-age length? The draft doesn't seem to specify when the Service
> should stop returning a success response for old resources.
>

The draft says

   If the Service Description changes, and the resource receives a
   request whose "If-Match" header identifies a previously served
   version that has not yet expired, it MUST return a success response
   containing the previous version.

So basically it's just the max-age.

5) A possible TODO: What should be the client's behavior if the
> response from the relay is rejected or if establishing the CONNECT-UDP
> tunnel fails? Fail-open? Fail-closed? Attempt check via alternative
> relay and/or choose different service? This could be
> application-specific logic, but it could be worth describing
> trade-offs of different behaviors in this situation.


Agreed!  I haven't thought much about what to do in this situation.


> In particular,
> the relay is in a position to maliciously perform a denial of service
> during this check and it could force the client to choose a different
> service (possibly one that will collude with the relay).
>

Interesting.

On a more nitty-note, I'm not sure how much you like the "DoubleCheck"
> name, but as another option we've referred to similar behavior as
> "multi-path verification".
>

I'm happy to adjust the name, but I do think we should try to make it clear
that this is a specific interoperable protocol, not just a strategy.

"Multi-path validation" attempts to solve more or less the same problem,
but it relies on different assumptions and achieves a different consistency
guarantee.