Re: [OAUTH-WG] draft-ietf-oauth-dpop-00 comments

Brian Campbell <bcampbell@pingidentity.com> Mon, 06 April 2020 18:06 UTC

Return-Path: <bcampbell@pingidentity.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 67D8E3A0A10 for <oauth@ietfa.amsl.com>; Mon, 6 Apr 2020 11:06:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 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, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=pingidentity.com
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 MUOVvOQhJrsa for <oauth@ietfa.amsl.com>; Mon, 6 Apr 2020 11:05:58 -0700 (PDT)
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (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 90FB43A0A08 for <oauth@ietf.org>; Mon, 6 Apr 2020 11:05:57 -0700 (PDT)
Received: by mail-lf1-x130.google.com with SMTP id m2so234278lfo.6 for <oauth@ietf.org>; Mon, 06 Apr 2020 11:05:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pingidentity.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9kT/GHNpHxImwmzOs1mTDBaonTvPpB/maSdGCFGO2TQ=; b=AgJz10ovYecbiglwMCJRELltfKOlogEmfyX59B3sBdfN4ubZ9zeRWoBbdblHKl6RFr z9HQCmQk+CCqlSfTR+nfVY+K46MlekLrj/XPNo/qSHXTVyIEySOcGiUss514OCVR4Bhj rVlea2HQFRFBJkQGwzBDMfZFcQeGAjWIIVHNogvtchhh6eKlKvnB0uGSnY05vfP48x/3 +rT+mC+lXVoWg6g2eA07aC0FIforaA5GnsMR5ha5TrB0Q42P44kM1tUU1Picq4S5+zJD YkmWW3aGIKJNZcvRZRKd3sJ/xHKKLYFITx0bNDEYr/9cVv173ILVA8oW6SisRUf3hXtK 6wow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9kT/GHNpHxImwmzOs1mTDBaonTvPpB/maSdGCFGO2TQ=; b=s4twsIHdr7GcNy2LQcw3O8TQNJ0eQbxeVn0g2uKB6uz9IKbIZAHQ9EgE9pV4E9/50C rJNbPFAesgrrCjMWlxcvbUklLscD7BypYyaNHkqiGNC9zovpXxNbgb6TJj5F2osLkymN 5xNC0/VcKThYT4F4UzPQtdHxCmwGEz4j/lLgGkfG99AxEiqK2vVi683D7WEt0//EgWGa onIebyUjPuJmnYpZzetx3L+bnUdSe3ZR7UC1iZEqbGOnPOHPSxWSLGZIi1eu6s2Rq/5y zTdq9MeSZ4MFJk+ynp6LI+tF7gmy6585kPWb715kaiaqA/+nGHfxSvYGiWKEqisfi+v7 M6KQ==
X-Gm-Message-State: AGi0PubGYtA6K7/2KuntJfdtOIbr1BxK1PbBnf7MpI19FUi+O4HnSnys i8BUQIzX/XYfPN0LfyBCuZdPIC8bxWJ8oLVxDpIu0KS8CDXiKVBcs8qopR/JaPQQ9TLgMS6RASH DR8K4aH+lXJguqw==
X-Google-Smtp-Source: APiQypKX4nEFDpPcKV09ewCWWBl4Drc/cDlG5vm72WZ7FVIFi7O2neO0dvqtTxgc0Umhf9zz+lJABFz4qVfz5rHla1w=
X-Received: by 2002:a19:f719:: with SMTP id z25mr4655507lfe.63.1586196355301; Mon, 06 Apr 2020 11:05:55 -0700 (PDT)
MIME-Version: 1.0
References: <0995BBB3-73E2-4831-B07E-BB5CB5F17AE9@mitre.org>
In-Reply-To: <0995BBB3-73E2-4831-B07E-BB5CB5F17AE9@mitre.org>
From: Brian Campbell <bcampbell@pingidentity.com>
Date: Mon, 06 Apr 2020 12:05:28 -0600
Message-ID: <CA+k3eCTpoOwwTWBqfWHpqeKDo4jGcgU9ockFq17-0W92q-08yg@mail.gmail.com>
To: "Peck, Michael A" <mpeck@mitre.org>
Cc: "oauth@ietf.org" <oauth@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000004d57a805a2a31eaf"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/7DAf7Ckae9SvNU30hAf04JcQg2w>
Subject: Re: [OAUTH-WG] draft-ietf-oauth-dpop-00 comments
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.29
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: Mon, 06 Apr 2020 18:06:00 -0000

Hi Mike,

Thanks for your interest in the work and review of the draft. As one of the
too-many authors on the document, I attempt to answer questions and respond
to comments inline below. Though I admit to not having necessarily adequate
answers to everything at the ready. And also apologize for the slow
response, which is somewhat related to not having necessarily adequate
answers.

On Wed, Apr 1, 2020 at 11:15 AM Peck, Michael A <mpeck@mitre.org> wrote:

> Hi,
>
> Glad to see DPoP moving forward as a working group item.
> I have a couple of comments on the current draft:
>
> 1.
> I recommend expanding the description of the threat model.
> It's not entirely clear to me what threats DPoP is expected to address,
> which makes it hard to evaluate whether DPoP meets its objectives.
>

Yeah, there's definitely some room for improvement in this area. And you
are not the first to note the need. Complicating matters somewhat, however,
is that there's some disparity of opinions about the specifics of the
threat model and objectives. Despite that I do plan to work on trying to
expand and clarify the threat model, objectives, expected applicability,
etc. in the next revision of the draft.


> Section 2 states that the main objective is to prevent an adversary who
> set up a counterfeit AS or RS from replaying a received refresh token or
> access token at another server. Would it be possible to expand upon the
> description of this threat and how it may occur?
>

I'm hoping perhaps Daniel can help expand on this as the current text
originated with him. Although I think separate consideration of AS and RS
would be helpful because I think the factors involved in counterfeiting or
confusing them are pretty different.


> Are there other situations where an adversary may be able to capture a
> refresh token or access token that should be mentioned as objectives to
> address - e.g. malicious / third-party JavaScript code?
>

Probably, yeah. Although any JavaScript code that could exfiltrate tokens
could also likely be used to drive an attack directly. And that possibility
can devolve into questioning the value of key-binding or preventing
exfiltration at all (similarish criticisms have been levied at the HttpOnly
cookie flag and HTTP Token Binding). I'm sympathetic to that line of
reasoning to the point of finding it somewhat depressing. But I try and
avoid falling into full-blown XSS nihilism and (maybe stubbornly/naively)
still think there's some value in key constraining tokens. And, to your
point, a more detailed look at potential leakage/theft situations would be
useful.



>
> Presumably the counterfeit AS or RS will not have the same hostname (e.g.
> with an illegitimately issued server certificate) as the legitimate server,
> as otherwise DPoP wouldn’t provide protection.


Yeah, an assumption (that admittedly should be made more explicit) is that
TLS/HTTPS with server authentication isn't broken.



> Why would the client send the refresh token to the wrong AS?
>

 Daniel maybe has some more ideas here but social engineering is the one
reason that I keep hearing. It's not super compelling but is a reason.



> For resource servers, why wouldn’t an access token audience restriction
> suffice? Is the concern that the access token might not contain an audience
> restriction, or might contain multiple audiences? (If the concern is that
> the resource server wouldn’t check the audience, I’d have a similar concern
> that it wouldn’t check a DPoP proof.)
>

Audience restriction can work to prevent RS to RS token usage. But in
practice it has turned out that properly getting and using audience
restricted ATs is prohibitively cumbersome for many deployments.


>
> 2.
> DPoP currently does not provide any guarantees that the DPoP signature was
> freshly generated, as there is no nonce from the server incorporated into
> the signature.
> I assume there is no practical means for the server to send a nonce to the
> client to use with each request that wouldn't over-complicate DPoP.
>

Keeping it relatively simple has definitely been a goal. And yeah, I can't
think of a practical way to do something like that without big changes. If
big changes are needed, the whole approach might be in question and
something like Neil's key agreement scheme that I mentioned in the last
interim
https://datatracker.ietf.org/meeting/interim-2020-oauth-02/session/oauth
could well be a better overall approach to consider.


> I also don't see any guidance in the draft about lifetime/rotation of each
> DPoP key or whether the same key can be used with multiple servers.
>

Some guidance would probably be useful.


>
> My concern is that something analogous to this Kerberos PKINIT attack -
> https://mailarchive.ietf.org/arch/msg/krb-wg/pLgID35fNG1Zh_QJjgXH9vEbwoQ/
> - could occur if DPoP signatures can be pre-computed by an adversary that
> somehow gains the ability to compute signatures with the private key but
> doesn't gain access to the private key itself. Could that potentially
> happen with malicious JavaScript code?
>

Trying to wrap my head around this and how it might happen but yes it would
seem that the kind of malicious JavaScript code (like XSS) that could
exfiltrate tokens or drive an attack directly could also pre-compute and
exfiltrate some DPoP proofs. I hadn't considered this and am honestly not
sure how problematic it is.


>
> The iat timestamp is insufficient since future values could be inputted
> with the signatures stored for later use. I could envision a private key
> potentially being re-used for a long period of time, and depending on how
> DPoP ends up getting used in practice, a private key being used with
> multiple servers?
>
> If guaranteeing some degree of freshness of the signature is a concern,
> one solution could be to incorporate the authorization code into the DPoP
> signature for token requests to the AS with grant_type=authorization_code,
> incorporate the refresh token into the DPoP signature for token requests to
> the AS with grant_type=refresh_token, and incorporate the access token into
> the DPoP signature for requests to a resource server. That would prevent
> pre-computing DPoP signatures before the authorization code / refresh token
> / access token is generated by the AS, as long as the recipient properly
> checks the DPoP proof.
>

That's an interesting consideration and along the lines (at least with
authorization code) of some of the conversations we had early on before the
first -00 draft was even written. And I've noticed that other signature
based proof concepts do typically propose having the signature cover the
access token (or hash thereof). Personally, I've gotten kind of attached to
the simplicity and consistency in the current draft of having the DPoP
proof be the same regardless of where it's presented. And I kind of cringe
at having to dig into the application layer to get at an authorization code
or refresh token value in order to verify the DPoP proof. Also considering
other grant types. So I don't want to move away from that too hastily.

But I suppose it depends on how much of a concern it is to ensure some
degree of freshness. And weighing that against the potential added
complexity of doing something like the above to try and get freshness. I'm
honestly not sure where I sit on it.


>
> I'd also suggest adding guidance on rotating the DPoP key - e.g.
> mandate/recommend that the client create a new keypair for each token
> request?
>

A recommendation like that (new keypair per token request and subsequent
access token usage) probably makes sense. I think. In the case of a bound
refresh token issued to a public client, the lifetime of the keypair would
need to correlate with the refresh token (unless facilities are added to
enable dpop key rotation in that scenario).


>
> Thanks,
> Mike
>
>
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth
>

-- 
_CONFIDENTIALITY NOTICE: This email may contain confidential and privileged 
material for the sole use of the intended recipient(s). Any review, use, 
distribution or disclosure by others is strictly prohibited.  If you have 
received this communication in error, please notify the sender immediately 
by e-mail and delete the message and any file attachments from your 
computer. Thank you._