Re: [OAUTH-WG] Comments on draft-richer-oauth-introspection-04

"Richer, Justin P." <jricher@mitre.org> Wed, 23 October 2013 19:22 UTC

Return-Path: <jricher@mitre.org>
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 5171911E8358 for <oauth@ietfa.amsl.com>; Wed, 23 Oct 2013 12:22:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.598
X-Spam-Level:
X-Spam-Status: No, score=-6.598 tagged_above=-999 required=5 tests=[AWL=-0.000, BAYES_00=-2.599, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-4]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ep+9jA37vQP6 for <oauth@ietfa.amsl.com>; Wed, 23 Oct 2013 12:22:43 -0700 (PDT)
Received: from smtpksrv1.mitre.org (smtpksrv1.mitre.org [198.49.146.77]) by ietfa.amsl.com (Postfix) with ESMTP id 1D43F11E834A for <oauth@ietf.org>; Wed, 23 Oct 2013 12:22:40 -0700 (PDT)
Received: from smtpksrv1.mitre.org (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id 770CF1F059C; Wed, 23 Oct 2013 15:22:39 -0400 (EDT)
Received: from IMCCAS04.MITRE.ORG (imccas04.mitre.org [129.83.29.81]) by smtpksrv1.mitre.org (Postfix) with ESMTP id 27DDE1F059A; Wed, 23 Oct 2013 15:22:39 -0400 (EDT)
Received: from IMCMBX01.MITRE.ORG ([169.254.1.251]) by IMCCAS04.MITRE.ORG ([129.83.29.81]) with mapi id 14.03.0158.001; Wed, 23 Oct 2013 15:22:38 -0400
From: "Richer, Justin P." <jricher@mitre.org>
To: Thomas Broyer <t.broyer@gmail.com>
Thread-Topic: Comments on draft-richer-oauth-introspection-04
Thread-Index: AQHO0CU84Zn8ICoUOUaw6JzqL1n5yQ==
Date: Wed, 23 Oct 2013 19:22:37 +0000
Message-ID: <63692DF5-4616-4F53-B12E-518397CFEFB3@mitre.org>
References: <CAEayHENijdeTVu9-OxsnrJEh0JQBrvQo0eKWSjFvXSLqwzVRWg@mail.gmail.com>
In-Reply-To: <CAEayHENijdeTVu9-OxsnrJEh0JQBrvQo0eKWSjFvXSLqwzVRWg@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [172.31.4.192]
Content-Type: multipart/alternative; boundary="_000_63692DF546164F53B12E518397CFEFB3mitreorg_"
MIME-Version: 1.0
Cc: "<oauth@ietf.org>" <oauth@ietf.org>
Subject: Re: [OAUTH-WG] Comments on draft-richer-oauth-introspection-04
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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: Wed, 23 Oct 2013 19:22:48 -0000

Hi Thomas,

You're right in that the introspection process is about getting meta data about a particular token by making an authenticated call. It does reveal a lot of information about the token -- because that's exactly the point of the protocol. :)

If the PR is compromised, then the attacker would be able to do anything the PR can do, including reusing any tokens handed to the PR (assuming they're bearer tokens). This is true without doing introspection at all, since you can just steal and start broadcasting the token. Also, if the PR is compromised, all the data protected at that PR is also compromised, so you've got other problems too.

The "resource_id" parameter is meant to be a service-specific hint that the PR can hand to the AS to give context to the transaction. You could easily use this field to pass along the list of scopes that you mention below. You can have your AS return no information other than the "valid" field in the response and leave out the scopes, subject, client id, and everything else. All those fields are optional. However, in practice we've found it very helpful to reveal to the PR which scopes and audiences that a token was issued for so that the PR can use that information to make authorization decisions. But if all you're after is answering the question "is this token valid" and you don't want any other information, your AS is fully allowed to do answer just that question.


As Eve pointed out in the other email, the introspection draft allows for a light "loose" binding between the AS and PR, but there's an assumption that the relationship was set up somewhere. UMA adds the possibilities of a deeper and more dynamic binding between PR and AS before introspection takes place. (In fact, the introspection draft was pretty much lifted out of UMA originally.) UMA also has a concept of permission sets that are more flexible and descriptive than scopes alone are, but those are added to the top of the base introspection response.

 -- Justin


On Oct 22, 2013, at 7:50 AM, Thomas Broyer <t.broyer@gmail.com<mailto:t.broyer@gmail.com>> wrote:

Hi all,

In a platform we're building, we have AS, clients and PRs all as distinct parties managed/provided by distinct companies. There's a single AS though, doing SSO through OpenID Connect (i.e. the AS in an OP).

I thus need a way for a PR to ask the AS whether the token presented by the client is valid and grants access to the PR. I've thus briefly evaluated draft-richer-oauth-introspection-04 which seemed to fulfill my needs. Here are my comments:

First, I'm a bit disturbed about privacy and potential security issues about the way this is done (disclaimer: I'm in no way a security expert). This draft is really about "introspection", and not "validation" of a token, and that might be the problem: it returns the information about a token to whoever asks for it (provided it authenticates, and possibly only if the token grants it access, but that would mean there's an association in the AS between scopes and registered PRs, themselves identified by a client_id); this is IMO disclosing too much information.
In case the PR is compromised, this information could be used to then reuse the token with other PRs inferred by the token's granted scopes and gain access to private information in a way that the End User didn't explicitly approved (he authorized the Client to access several PRs, he didn't authorize exchanges between PRs directly). This could be mitigated by *not* using Bearer tokens (using some sort of 'proof token' instead, e.g. either MAC or JWT), but there's no reason we couldn't have such a feature/endpoint that could work securely with Bearer tokens (I don't want to put too much burden on client and PR implementers).
Before I saw this draft, my idea was to have an endpoint at the AS where the PR would send the token received by the Client *and* the scopes corresponding to the request being done (and the "sub" of the End-User if it was part of the request; in our case, we use it as a global identifier shared by all parties involved; we might change to per-party IDs and then use that endpoint to "translate" the ID as known by the Client to the ID as known by the PR, but this is another story), and the AS would answer with just a "yes" (HTTP/1.1 204 No Content) or "no" (400 Bad Request with a JSON payload similar to the Error Response from Section 5.2 or RFC 6749, with the same error codes as defined by RFC 6750; that way the PR can just "translate" the error response to a WWW-Authenticate: Bearer response header). That way, the PR does not know where else the token is "valid", i.e. what it could do with it.

Second thing, the draft talks about a "resource_id" but doesn't say how it could be used, and whether it'll be used at all by the server, what impact it could have on the response, etc. Could that resource_id replace the "list of scopes" from my implementation idea? The PR would need to know the list of scopes to return the correct WWW-Authenticate header anyway (assuming a Bearer token is used here), so I'm not sure it's really better. And the resource_id is optional, so what would happen if it's not provided? you'd have *more* information returned? I understand that this is just a framework and each server would have its own rules, but you're then either saying too much or too few.

Thanks in advance for any guidance about how to achieve my goal. Should I go with introspection? (maybe I misunderstood something, or saw a threats where there isn't) or should I use something else? Does my initial idea make sense? Should I go with it?

--
Thomas Broyer
/tɔ.ma.bʁwa.je/<http://xn--nna.ma.xn--bwa-xxb.je/>