Re: [OAUTH-WG] OAuth Security Topics -- Recommend authorization code instead of implicit

Neil Madden <neil.madden@forgerock.com> Tue, 20 November 2018 12:25 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 60380130E10 for <oauth@ietfa.amsl.com>; Tue, 20 Nov 2018 04:25:22 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 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, URIBL_BLOCKED=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 N6C1SyCqAKpj for <oauth@ietfa.amsl.com>; Tue, 20 Nov 2018 04:25:19 -0800 (PST)
Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 7796F130DFA for <oauth@ietf.org>; Tue, 20 Nov 2018 04:25:19 -0800 (PST)
Received: by mail-wr1-x436.google.com with SMTP id 96so1775964wrb.2 for <oauth@ietf.org>; Tue, 20 Nov 2018 04:25:19 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=forgerock.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nEfTORhgwc7fg6z+w1ijwOMbbjE5chIzDUAYgI5vgwM=; b=WLXPI91OvZzohrGBFrTi85iHqiBtjdHYEIGKKqy1f/qyR6ua0NnPJDZDI+Jpy4Xocb yvnEwAOK9/dir4Rq7v4M1MtGnrV+qwQxQJ/IR9xD0Szk1U6XqJg8Tta2WUTx4ASfqYs4 3ZqUOzoO0jiZm3hsSKUGdeCKcLbOwLG4+yQkI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=nEfTORhgwc7fg6z+w1ijwOMbbjE5chIzDUAYgI5vgwM=; b=MTxIbhZUEgeN4dmXu5fEdqiVg6STqA8DDV/3ISweAlQt5S8JTVRiIdkQJWWEILJAO9 mco44aMg8rzpXTUwN3/K4nAHKtUOoXvZb3zpbkwWOBb0xheT28JKNHt+/PUXobpKGVyD XGx/Qz4l1WHUcm0MEwdZAQCghljBaqFLt3MU+F/TQGLSIoneoxoRw8uj95wLH1j6RPRk UBeT1CFwlfhZE0dNDPat2d+aUvQnHNIf6sgN1C0sVJ1e8zJMkiXw/evN8BvxSMMiLdyt 1BO++DOqmBgjPC1vr3WcUDmdxeJT7jXPl4/tkv9keooW1prFyB4HerE6EyImlJwMEO8O WJmg==
X-Gm-Message-State: AA+aEWbYfWbgdTCaSVl/+5iCTqOK8tW/ucVvBdOC4FCPJ7icHOFQFrZB 6EpFk1ye7Z6l5h89LldfWydiEkisnt0=
X-Google-Smtp-Source: AFSGD/VTQHOjUc+SR1dqZA8KTt19nCEYJI5uc1zg6HloI03nVEonQNNQXpPQxCKHZd2xK6SWJ0rbxw==
X-Received: by 2002:a5d:63c3:: with SMTP id c3mr1748323wrw.215.1542716717743; Tue, 20 Nov 2018 04:25:17 -0800 (PST)
Received: from ?IPv6:2a01:4c8:1a:2953:c800:a6d5:81ac:d199? ([2a01:4c8:1a:2953:c800:a6d5:81ac:d199]) by smtp.gmail.com with ESMTPSA id d4sm39195561wrp.89.2018.11.20.04.25.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 04:25:16 -0800 (PST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\))
From: Neil Madden <neil.madden@forgerock.com>
In-Reply-To: <61A6D327-D4EE-4954-B57F-4FF42BB22E7E@lodderstedt.net>
Date: Tue, 20 Nov 2018 12:24:55 +0000
Cc: Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>, oauth <oauth@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <3AA54AC6-BE0B-4535-AF1D-919236EF69B8@forgerock.com>
References: <VI1PR0801MB211266BA6F6E06FFB3081425FAD80@VI1PR0801MB2112.eurprd08.prod.outlook.com> <BL0PR00MB029244CACC634E2D2E923B77F5D80@BL0PR00MB0292.namprd00.prod.outlook.com> <61A6D327-D4EE-4954-B57F-4FF42BB22E7E@lodderstedt.net>
To: Torsten Lodderstedt <torsten@lodderstedt.net>
X-Mailer: Apple Mail (2.3445.101.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/HdUaA4alVY5JijuI5jXxm2RXcdM>
Subject: Re: [OAUTH-WG] OAuth Security Topics -- Recommend authorization code instead of implicit
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: Tue, 20 Nov 2018 12:25:22 -0000

I think the draft should elaborate more on what it means by “token replay” in section 2.2 and how the proposal to use sender-constrained tokens prevents it. As far as I can tell, of the 4 methods presented in section 3.8.1.2, only jpop signed requests actually includes any specific countermeasure for replay (in the form of negotiated nonces). 

If we are discussing this in the context of client-side web apps/SPAs, then surely the threat model includes malicious 3rd party scripts - for which neither token binding nor mTLS constrained tokens are very effective as those scripts run in the same TLS context as the legitimate client?

— Neil

> On 20 Nov 2018, at 07:35, Torsten Lodderstedt <torsten@lodderstedt.net> wrote:
> 
> Hi Mike, 
> 
> I agree that OIDC hybrid flows offer additional security over the OAuth implicit grant and are used in the wild. On my slides and in the initial version of the new section, we had included the hybrid OIDC flows because of their known token injection countermeasures.
> 
> I nevertheless feel very uncomfortable to recommend those flows and any flow issuing access tokens in the front channel. In the course of the detailed review of the new text we realized two issues: 
> 
> 1) Since the access token is exposed in the URL, such flows possess a significantly higher risk to leak the access token (e.g. through browser history, open redirection and even referrer headers) than the code grant.
> 2) There is no viable way to sender constrain access tokens issued in the front channel. Given the WG decided to recommend use of sender constraint tokens (https://tools.ietf.org/html/draft-ietf-oauth-security-topics-09#section-2.2), it seems contradictory to recommend response types not supporting such an approach. 
> 
> kind regards,
> Torsten. 
> 
>> Am 19.11.2018 um 23:13 schrieb Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>:
>> 
>> This description of the situation is an oversimplification.  OpenID Connect secures the implicit flow against token injection attacks by including the at_hash (access token hash) in the ID Token, enabling the client to validate that the access token was created by the issuer in the ID Token (which is also the OAuth Issuer, as described in RFC 8414).  (Note that this mitigation was described in draft-ietf-oauth-mix-up-mitigation.)
>> 
>> Given the prevalence of this known-good solution for securing the implicit flow, I would request that the draft be updated to describe this mitigation.  At the same time, I’m fine with the draft recommending the code flow over the implicit flow when this mitigation is not used.
>> 
>>                                                                Thank you,
>>                                                                -- Mike
>> 
>> From: OAuth <oauth-bounces@ietf.org> On Behalf Of Hannes Tschofenig
>> Sent: Monday, November 19, 2018 2:34 AM
>> To: oauth <oauth@ietf.org>
>> Subject: [OAUTH-WG] OAuth Security Topics -- Recommend authorization code instead of implicit
>> 
>> Hi all,
>> 
>> The authors of the OAuth Security Topics draft came to the conclusion that it is not possible to adequately secure the implicit flow against token injection since potential solutions like token binding or JARM are in an early stage of adoption. For this reason, and since CORS allows browser-based apps to send requests to the token endpoint, Torsten suggested to use the authorization code instead of the implicit grant in call cases in his presentation (seehttps://datatracker.ietf.org/meeting/103/materials/slides-103-oauth-sessb-draft-ietf-oauth-security-topics-01).
>> 
>> A hum in the room at IETF#103 concluded strong support for his recommendations. We would like to confirm the discussion on the list.
>> 
>> Please provide a response by December 3rd.
>> 
>> Ciao
>> Hannes & Rifaat
>> 
>> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
>> _______________________________________________
>> OAuth mailing list
>> OAuth@ietf.org
>> https://www.ietf.org/mailman/listinfo/oauth
> 
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth