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

John Bradley <ve7jtb@ve7jtb.com> Tue, 20 November 2018 22:29 UTC

Return-Path: <ve7jtb@ve7jtb.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 0230B130E72 for <oauth@ietfa.amsl.com>; Tue, 20 Nov 2018 14:29:36 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, 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 (2048-bit key) header.d=ve7jtb-com.20150623.gappssmtp.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 t5c0Zi6_RHnB for <oauth@ietfa.amsl.com>; Tue, 20 Nov 2018 14:29:31 -0800 (PST)
Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) (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 46E45130EA5 for <oauth@ietf.org>; Tue, 20 Nov 2018 14:29:31 -0800 (PST)
Received: by mail-wr1-x42b.google.com with SMTP id x10so3624943wrs.8 for <oauth@ietf.org>; Tue, 20 Nov 2018 14:29:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ve7jtb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pbmu9/CYHGstghmOKrCd/nsPzg7UdMrhN+hE4adDJJM=; b=miulnjWXbiwiEHOTXPPF3c8dcHEEj4eRKFdoSYy5ROQLvr0GMoS4oahVITTMMokjAs cAC7SxaMLUMJfgcyfOWH6wuZZeZ/W3bM0tq38v1BjqLp7K67ixWPtIR1l7hNnkTmVze3 0FJllPRHa1VuyjiWHCjgHl/VQ7c0ly2+MqcWTDKcgpyhl1dqgvfBRkSWG6KWctxcyIDn cTjNLlWUafW1NHaDBl0qzqGIh6d/GcQOapquB8UncTWR7Co8Hs51WwWckI/pGQNiJqbh UmvTREPnAG5Z+5Ca0j0lDRbOdjfAPiHqBXhSmlVHZzGkodeiGdwsKcL5mxZFvs9ip+rb 5v6g==
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=pbmu9/CYHGstghmOKrCd/nsPzg7UdMrhN+hE4adDJJM=; b=qhfu6X3+rtrspG+AlBXhbcfLLd3VeaMgbcM3/O6T7bX1duUrf+CaNKf1QgOQ7snGPi qmPfvgatnJYTxZ6giwAh4tQbuK4y0H57QoCEj8Z2jHWmJmZq+TRT248N9Wg+EqAcaYoQ RCf+6PuTFNxHpug4uojHRmR6hUcxzf5sYqCgYfrSbNYS/98IL7IXiu1ylujaRSkOKLnb qm6NX6QTM6rRCNE7/3TmwzlGEtgGk8dAbYwora3t7TmH4vLXkjEH2i+9SYiT4PCf3Pc9 PbLfhmtJ9Z9o1Kn1aWWbutAuTQlsevv6/B+IM6bwGCgqmM3HQwOx0RhSNSL5BMXC2uwM pdIw==
X-Gm-Message-State: AA+aEWY7dKznkyIW4iMghluVV/AiZBOURkw1wSvJ4QRAJi0q0JDM7Sba FwDYOsBw2+ulYNv3UAxucz1MuM0PRzN//Qa1oMHxfA==
X-Google-Smtp-Source: AFSGD/VUrADQb9NMyQy5xGow1FyMJ4gw9OHEsdd3L0phdEN7uV26sptbDwjEKRhdUKt1cJh5uo5itINlydb0bEM4bpQ=
X-Received: by 2002:adf:800b:: with SMTP id 11-v6mr3761653wrk.106.1542752969031; Tue, 20 Nov 2018 14:29:29 -0800 (PST)
MIME-Version: 1.0
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>
In-Reply-To: <3485431a-74fc-408e-5360-c87c4bafc1fa@aol.com>
From: John Bradley <ve7jtb@ve7jtb.com>
Date: Tue, 20 Nov 2018 19:29:15 -0300
Message-ID: <CAANoGhKNnQ-o-bBT+kL71d=pjAC_C6qS-2a5TCgE8CnzL1f6cA@mail.gmail.com>
To: George Fletcher <gffletch@aol.com>
Cc: Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>, "oauth@ietf.org" <oauth@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000b2163b057b202a1d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/wOAjgfkD0T437u_Oj1HPAufygwM>
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 22:29:38 -0000

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> <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> <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> <oauth-bounces@ietf.org> On Behalf Of Hannes Tschofenig
>
> Sent: Monday, November 19, 2018 2:34 AM
>
> To: oauth <oauth@ietf.org> <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 listOAuth@ietf.orghttps://www.ietf.org/mailman/listinfo/oauth
>
>
>