Re: [OAUTH-WG] Token scanning attacks in RFC 7662

Neil Madden <neil.madden@forgerock.com> Tue, 02 January 2018 17:02 UTC

Return-Path: <neil.madden@forgerock.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 B86F3127863 for <oauth@ietfa.amsl.com>; Tue, 2 Jan 2018 09:02:00 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Level:
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=forgerock.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 jF8E7YDEaLUJ for <oauth@ietfa.amsl.com>; Tue, 2 Jan 2018 09:01:58 -0800 (PST)
Received: from mail-wr0-x22c.google.com (mail-wr0-x22c.google.com [IPv6:2a00:1450:400c:c0c::22c]) (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 A71B2124319 for <oauth@ietf.org>; Tue, 2 Jan 2018 09:01:57 -0800 (PST)
Received: by mail-wr0-x22c.google.com with SMTP id l19so36753542wrc.2 for <oauth@ietf.org>; Tue, 02 Jan 2018 09:01:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=forgerock.com; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=y+uio8lzeQEkZc+TXfNBYv86JtihFjm0r5JYm5A2FZ4=; b=h8hd3J3SseIBUTK0rZDdEuR4ldef8bgZxwb4P3Dyf6Vgs0G3sOmw2oplyDJuhmKUlj WiAFR26FQzow0PlUpWD7YGFmmxGr7b9taRVoX5yR1JA0sakEP+I7XH8QK6p2H1PKj5La iLSMnFNZB2s9BYcEBM4EtGGA9F2+jj+JUtl/4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=y+uio8lzeQEkZc+TXfNBYv86JtihFjm0r5JYm5A2FZ4=; b=gdzBkEHadmatM/dxe7CVHMdDsDPg4v5YQ1ejdQMKP1K4/+miP4CUS4B+kQNCR30LSE skdpqImq0rZ5rPdKl1zz/UPIHcBrv8j0a6FY7BopDinyqH+nuSjoo4YvwqzyLl9IbM2E AK4wXWoeG5XoAnpdFhvK/eHdnx6yz6Hae2IjUCffe3GLBI404iu4ounQ7fES5dKf2OTD 6V6KbLqQg4eagfpKDe/c6aVliDvLsBiTYgMbTr8LFVwa3AapGvmAhU0VCgSmYkWkRhCF dcp6VEkulNYKChre/rOIDHd0ECGxPaFda5xcAeahbu6ZbYnrgUoqTZfUyn9uV7RyQpMl yyxg==
X-Gm-Message-State: AKGB3mI7ulrq6ivd9lllJVYKt1kSUb7FQ/l/U7B3YVq2adoti7hd4FM6 SaXX06PrmeAuIyZ+5Yy/zkXC0g/bEbs=
X-Google-Smtp-Source: ACJfBouhS+pveMQ5C6NyOZ5ux8mRyeZHXp0523anw/lHqQWOeF44mDkSvqhQylruNxTRANpME7m2VA==
X-Received: by 10.223.176.86 with SMTP id g22mr49110343wra.267.1514912516061; Tue, 02 Jan 2018 09:01:56 -0800 (PST)
Received: from guest2s-mbp.home (53.150.32.217.dyn.plus.net. [217.32.150.53]) by smtp.gmail.com with ESMTPSA id a69sm16218874wma.25.2018.01.02.09.01.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jan 2018 09:01:54 -0800 (PST)
From: Neil Madden <neil.madden@forgerock.com>
Message-Id: <15B4232D-F137-426D-B9B3-D33DF9B5B7A2@forgerock.com>
Content-Type: multipart/signed; boundary="Apple-Mail=_E93FC5C2-CE2A-4D7A-86F2-2EF4C9293A1E"; protocol="application/pgp-signature"; micalg=pgp-sha256
Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\))
Date: Tue, 2 Jan 2018 17:01:40 +0000
In-Reply-To: <665AE14D-F8A4-444E-88BF-B596937FF855@ve7jtb.com>
Cc: OAuth WG <oauth@ietf.org>
To: John Bradley <ve7jtb@ve7jtb.com>
References: <AF1C81BC-485C-4BAB-9415-D85FAF50977D@forgerock.com> <665AE14D-F8A4-444E-88BF-B596937FF855@ve7jtb.com>
X-Mailer: Apple Mail (2.3445.5.20)
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/2GcOf7UUpR_mbdkG6AdWMdgUmjI>
Subject: Re: [OAUTH-WG] Token scanning attacks in RFC 7662
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.22
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: Tue, 02 Jan 2018 17:02:01 -0000

The requirement on 128-bit entropy is a MUST in RFC 6749. There is a SHOULD for the stronger 160-bit level. How does authentication address the problem?

Neil

> On 2 Jan 2018, at 15:06, John Bradley <ve7jtb@ve7jtb.com> wrote:
> 
> In reality people developers may not always be putting that much entropy into a token.   It is only a SHOULD and hard to enforce.  I may have come up with the min entropy number.
> 
> There may also be side channel attacks if you allow introspection of encrypted or signed tokens.
> 
> There is also a potential privacy issue if you return a bunch of PII in the token response.  If the token leaked it perhaps can’t be used if it isa POP token but you may still leak PII via introspection.
> 
> In general I am not a big fan of introspection.  We didn’t include it in Connect.  However the pattern is used in a number of commercial products to have the RS introspect tokens at the AS.
> It was decided by the WG that having a standard would reduce the number of things people need to support when you have things like a DataPower talking to Ping Fed or something like that.
> 
> Given that this is mostly used by RS I think the decision was made to err on the side of caution, as authentication is not a huge burden.
> I recall it being discussed and some people didn’t want to do authentication.
> 
> It is not cut and perhaps in some cases it might not be required, however that would introduce a option that people may get wrong in implementations.
> 
> Happy New Year
> John B.
> 
>> On Jan 2, 2018, at 9:42 AM, Neil Madden <neil.madden@forgerock.com> wrote:
>> 
>> Greetings, and Happy New Year!
>> 
>> I was just re-reading the OAuth 2.0 token introspection RFC 7662, and I am a bit confused by the rationale for requiring client (RS) authentication when making calls to this endpoint. The stated rationale in Section 2.1 (https://tools.ietf.org/html/rfc7662#page-5) is:
>> 
>> “To prevent token scanning attacks, the endpoint MUST also require
>>  some form of authorization to access this endpoint, such as client
>>  authentication as described in OAuth 2.0 [RFC6749] or a separate
>>  OAuth 2.0 access token such as the bearer token described in OAuth
>>  2.0 Bearer Token Usage [RFC6750].”
>> 
>> This rationale is elaborated in the Security Considerations:
>> 
>> "If left unprotected and un-throttled, the introspection endpoint
>>  could present a means for an attacker to poll a series of possible
>>  token values, fishing for a valid token.  To prevent this, the
>>  authorization server MUST require authentication of protected
>>  resources that need to access the introspection endpoint and SHOULD
>>  require protected resources to be specifically authorized to call the
>>  introspection endpoint.”
>> 
>> However, RFC 6749 already requires that access tokens be unguessable with a probability of successful guesses being at most 2^(-128) [https://tools.ietf.org/html/rfc6749#section-10.10]. Assuming that this means something like: if an attacker makes 2^n guesses then they have a maximum chance of guessing a particular access token of at most 2^(n-128), then I think the token scanning attacks are already taken care of aren’t they? It is not feasible for an attacker to make that many queries. Even if you consider that the attacker only needs to guess one out of the set of all valid access tokens, then I still don’t think this attack is feasible in any realistic time-frame, especially if you follow the “SHOULD" recommendation to require at most 2^(-160) probability.
>> 
>> Is there some other threat model being considered here? Timing side-channels maybe?
>> 
>> Also, I cannot find a justification in the RFC for how this threat is mitigated by requiring authentication. Is the assumption that this is a closed ecosystem where malicious parties cannot get valid credentials?
>> 
>> Kind regards,
>> 
>> Neil
>> 
>> --
>> Neil Madden
>> Security Director, ForgeRock Engineering.
>> Email: neil.madden@forgerock.com     PGP: 90F8 43DF 4EDD AC5D
>> Bugs/Reports: security@forgerock.com PGP: 6D19 AD77 1F43 ADAD
>> 
>> _______________________________________________
>> OAuth mailing list
>> OAuth@ietf.org
>> https://www.ietf.org/mailman/listinfo/oauth
>