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

Torsten Lodderstedt <torsten@lodderstedt.net> Thu, 22 November 2018 04:44 UTC

Return-Path: <torsten@lodderstedt.net>
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 40D46130E6F for <oauth@ietfa.amsl.com>; Wed, 21 Nov 2018 20:44:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
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 ZYLq4ZqSGvS6 for <oauth@ietfa.amsl.com>; Wed, 21 Nov 2018 20:44:39 -0800 (PST)
Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.18.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2577D130FAF for <oauth@ietf.org>; Wed, 21 Nov 2018 20:44:39 -0800 (PST)
Received: from [80.187.120.70] (helo=[10.149.176.184]) by smtprelay03.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from <torsten@lodderstedt.net>) id 1gPgqw-0007cS-FX; Thu, 22 Nov 2018 05:44:34 +0100
Content-Type: multipart/signed; boundary="Apple-Mail-1506B0D3-2B2E-44C1-AA58-C7AD3FE90156"; protocol="application/pkcs7-signature"; micalg="sha-256"
Mime-Version: 1.0 (1.0)
From: Torsten Lodderstedt <torsten@lodderstedt.net>
X-Mailer: iPhone Mail (16B92)
In-Reply-To: <21a00a22-0524-07de-ac0e-77d597e5a9a1@aol.com>
Date: Thu, 22 Nov 2018 05:44:23 +0100
Cc: John Bradley <ve7jtb@ve7jtb.com>, Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>, "oauth@ietf.org" <oauth@ietf.org>
Content-Transfer-Encoding: 7bit
Message-Id: <DDC7F811-9F95-48B4-AC80-C92C638B7690@lodderstedt.net>
References: <VI1PR0801MB211266BA6F6E06FFB3081425FAD80@VI1PR0801MB2112.eurprd08.prod.outlook.com> <BL0PR00MB029244CACC634E2D2E923B77F5D80@BL0PR00MB0292.namprd00.prod.outlook.com> <61A6D327-D4EE-4954-B57F-4FF42BB22E7E@lodderstedt.net> <90e0cb05-5245-1a67-4eca-16996e7db2fc@ve7jtb.com> <DM5PR00MB02937F639067DC15DC9D80D4F5D90@DM5PR00MB0293.namprd00.prod.outlook.com> <3485431a-74fc-408e-5360-c87c4bafc1fa@aol.com> <CAANoGhKNnQ-o-bBT+kL71d=pjAC_C6qS-2a5TCgE8CnzL1f6cA@mail.gmail.com> <ADF0AB95-6B6A-4535-B22D-29E69B216CE7@lodderstedt.net> <21a00a22-0524-07de-ac0e-77d597e5a9a1@aol.com>
To: George Fletcher <gffletch@aol.com>
X-Df-Sender: dG9yc3RlbkBsb2RkZXJzdGVkdC5uZXQ=
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/dLuLXEmNOheyc_qBKUGknUBjQts>
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: Thu, 22 Nov 2018 04:44:44 -0000

that’s certainly true, but that might by a web server with static content only.

If the server is a real backend, there is even less reasons to use a implicit or hybrid. No even a performance gain in comparison to code.

> Am 21.11.2018 um 14:24 schrieb George Fletcher <gffletch@aol.com>:
> 
> An SPA has a backend because it has to be loaded from somewhere :)
> 
>> On 11/21/18 3:47 AM, Torsten Lodderstedt wrote:
>> We had a discussion about this topic on Twitter https://twitter.com/Apl3b/status/1064854507606208513
>> 
>> Outcome is POST requires a backend to receive the request so it’s not a viable solution for SPAs.
>> 
>>>> Am 20.11.2018 um 23:29 schrieb John Bradley <ve7jtb@ve7jtb.com>:
>>>> 
>>>> Post response works OK for server based clients.  I don't think POST works for single page applications.  
>>>> 
>>>> Basically that would be something more like postmessage between two JS apps.  
>>>> 
>>>> Postmessage also has security issues passing a access token and leaking.  
>>>> 
>>>> Perhaps someone more familiar with SPA can comment on POST.  
>>>> 
>>>> John B. 
>>>> 
>>>> 
>>>> 
>>>> On Tue, Nov 20, 2018, 6:40 PM George Fletcher <gffletch@aol.com wrote:
>>>> Hi Mike,
>>>> 
>>>> The Form Post Response Mode keeps the access_token out of the URL, but it doesn't prevent the token from traversing through the browser. So a man-in-the-browser attack may be able to intercept the values. It should help with leakage in logs.
>>>> 
>>>> Thanks,
>>>> George
>>>> 
>>>> On 11/20/18 4:00 PM, Mike Jones wrote:
>>>> Next question – doesn’t using the Form Post Response Mode https://openid.net/specs/oauth-v2-form-post-response-mode-1_0.html mitigate the threats you’re describing below John?  If so, I believe the Security Topics draft should say this.
>>>> 
>>>>  
>>>> 
>>>> I believe we owe it to readers to present the complete picture, which is why I believe that describing profiles using ID Tokens and the Form Post Response Mode are in scope.
>>>> 
>>>>  
>>>> 
>>>>                                                        -- Mike
>>>> 
>>>>  
>>>> 
>>>> From: OAuth <oauth-bounces@ietf.org> On Behalf Of John Bradley
>>>> Sent: Tuesday, November 20, 2018 7:47 AM
>>>> To: oauth@ietf.org
>>>> Subject: Re: [OAUTH-WG] OAuth Security Topics -- Recommend authorization code instead of implicit
>>>> 
>>>>  
>>>> 
>>>> Yes the at_hash protects the client from accepting an injected AT. 
>>>> 
>>>> Unfortunately it doesn't do anything to protect against leakage in logs or redirects.
>>>> 
>>>> So without the AT using some sort of POP mechanism it is hard to say sending it in a redirect is a good security practice.
>>>> 
>>>> John B.
>>>> 
>>>> On 11/20/2018 4:35 AM, Torsten Lodderstedt 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
>>>> 
>>>> 
>>>> _______________________________________________
>>>> 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
>