Re: [OAUTH-WG] Downgrade attacks on PKCE

Mike Jones <Michael.Jones@microsoft.com> Mon, 01 June 2020 19:11 UTC

Return-Path: <Michael.Jones@microsoft.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 3DA793A150A for <oauth@ietfa.amsl.com>; Mon, 1 Jun 2020 12:11:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001, 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=microsoft.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 E0Ug8gcHgoSW for <oauth@ietfa.amsl.com>; Mon, 1 Jun 2020 12:11:29 -0700 (PDT)
Received: from NAM06-BL2-obe.outbound.protection.outlook.com (mail-eopbgr650113.outbound.protection.outlook.com [40.107.65.113]) (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 C96643A150B for <oauth@ietf.org>; Mon, 1 Jun 2020 12:11:28 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I42s1xumM866nD3b3kJYh/KmqABHRJ9y1389N2k9EccRepkJ2tRV/C5uIBGrAYOf/v9kU+4hBEDcbxFh9UoUP/CRBP05bH1aprtw4uGcRZTrPnQDQAlxO4rCtwkMWVVEG+Wh+PaK2jzHAElHXAb3YqOJ8hJQxWuh4pe39U6nuh6ys/2DhGWCzK9bx62QrIBIvIE/s38f2Wcx74AXWt790YKuX4cX0RIzFD2NBinA5NW1V+wnFhv3HmlAh0jh855DrqYExZX+2qzdzcWxMXlLz0eKAqCkIkczO+TUZgaOLQErMBcQlDmuvGhDcjorT0A6csUV3mQl6/ZxF0XHzhrzXg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hrByEIvsAi1M+Xu4je3vsmu5PvOPtMG229U9cdmK0n0=; b=SzKbm3vWCpflL1qWXjy83kqQtaL8XO6hDmsmAI52bAUCIf6/ZH6x8IEReNa2m2yryszuOPPSHXfZtI4tMO9yMA3OG1OPm13xklzVoTgEeoUKVOXL5cynRBdaH/Vaxvr2EtGvQwlhCUYEcWeIcyfrCUOaQpdhmo0vzO46K0qwNChYhJEFv25ubz3EQeBXDVbSynu9EZSjmN2Zk32+7ScgSDQ06STe9he4oC6UyHPTNBN7FuQ9zZXcYM/5bFsD4l3upZ+dSI43LCe+Hn/zLWR7i204Affau8b2rMl1RFnZe+C1lYUymNd1gWe9kBLgR5N7HTDx2E3b584xhPU/mbuzDg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hrByEIvsAi1M+Xu4je3vsmu5PvOPtMG229U9cdmK0n0=; b=cwBabnDM4b7ItnlVKfsgi0TfOPC96e0Ht9V+Ylf0ZqH+44Ssf/SvUSvVwsUYkuZbxR+kjM25a3qdHHzisXXAox4mP/jjG+raMnrM0iGoKtcJBpi9PfKx+VQ1+yqgodgkBrgWuryY0hTLJyktyQOj76/y5vDB1C6qyTGjyhDskJo=
Received: from MN2PR00MB0688.namprd00.prod.outlook.com (2603:10b6:208:199::23) by BL0PR00MB0323.namprd00.prod.outlook.com (2603:10b6:207:1f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3094.0; Mon, 1 Jun 2020 19:11:26 +0000
Received: from MN2PR00MB0688.namprd00.prod.outlook.com ([fe80::d8cb:32d6:fcd9:4c17]) by MN2PR00MB0688.namprd00.prod.outlook.com ([fe80::d8cb:32d6:fcd9:4c17%9]) with mapi id 15.20.3101.000; Mon, 1 Jun 2020 19:11:26 +0000
From: Mike Jones <Michael.Jones@microsoft.com>
To: Dick Hardt <dick.hardt@gmail.com>, Neil Madden <neil.madden@forgerock.com>
CC: Daniel Fett <fett@danielfett.de>, "oauth@ietf.org" <oauth@ietf.org>
Thread-Topic: [OAUTH-WG] Downgrade attacks on PKCE
Thread-Index: AdY4SHGdz8Mrlse7SpiGnPEG3tbLTg==
Date: Mon, 1 Jun 2020 19:11:26 +0000
Message-ID: <MN2PR00MB0688661C391F3234CBFB9812F58A0@MN2PR00MB0688.namprd00.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=0c6b5ef4-1ac0-40a8-9154-0000300e6bb8; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-06-01T19:09:12Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=microsoft.com;
x-originating-ip: [50.47.87.252]
x-ms-publictraffictype: Email
x-ms-office365-filtering-ht: Tenant
x-ms-office365-filtering-correlation-id: 10c599ea-cf9f-4e9e-f4d6-08d8065f9547
x-ms-traffictypediagnostic: BL0PR00MB0323:
x-microsoft-antispam-prvs: <BL0PR00MB032318D74B2C2FE6F0B9672AF58A0@BL0PR00MB0323.namprd00.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:7219;
x-forefront-prvs: 0421BF7135
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: KWh/0zBtaEGphSeVPsbXVKTdTV5Xo1Aml29W8vkOre/hzk5IpLoA4c9MbdYRm6rgwpLmnPd/gtqGtdtux4uOHm/jMDXMf+HxQx6Ul4QyvWcaZbrshB4NjeX3jF5VIEx1NJSpofQUzSF0y39pSNfWpZhqSYtfsXImCn4gBT7BKiDjhNTN6jV9IO6LdzCBWj+yf51BW3Si3Kk2vesvzAnmW7VamFcJvKFIhvx1BQFFL76ojUz1joa9qa84iHSFj2aZYtuGBmPqCPYVQVRtlRozxC8XiWl1kgaPsglNnzsCqqrjjR9LJ4+2QQ4WDikVOd94j36EJ5UiWYOrZRcmEa1MOF33+lvarLXb8cbKb+afICbtv4/2f7AtK6kTXer4NMUBjx0YdvISMKto9OkxNQ8maIxu9NAgRej9XUxFKunbInMRiPi4E/MVY7K9HXxO/5kvbjpUGQOr8PhHc0X/AVYOUg==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR00MB0688.namprd00.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(376002)(346002)(39860400002)(366004)(136003)(55016002)(166002)(8676002)(86362001)(9686003)(2906002)(76236002)(66476007)(64756008)(66446008)(966005)(66556008)(7696005)(52536014)(8990500004)(5660300002)(10290500003)(54906003)(8936002)(110136005)(82950400001)(186003)(83080400001)(82960400001)(26005)(316002)(53546011)(71200400001)(4326008)(66946007)(76116006)(83380400001)(478600001)(6506007)(33656002)(99710200001); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: tK79tW/TP7bxWgM8ddn4SUG6o8wztDV5QyKR5NYf1IYbi/50Ehbt9dwF3qH/YJHYXc2ogZTpWN8Z6UMAYUQ11Off2ybVCN20t4kG8CFLELG2h6yoyyhG0WFzuiHRnZfxlKu7BYNbHMTLDYaPXmYaURVbAZmD7L48z41qm8jtd75ie2MLGWzLvsLrEH3Tmsefy1iMB/sZoTq8PNrs3KeD+N4YcfvZPFVRgcCXYkS5Hm+48JkXa30cHUkFT+KQjXi6/uLYoZUui4EswhaRv92fC052BBBL0GDzIhFBRkH0h9sSb3hr40xF32MMmgTcfXtTW2YfW3GnAdJt0ql3j88KPtaQZdTBv7ks2iI06c4D6lIsYPRICh2psrii/91VgNBDmkBDUYHkRhuLWUwEPNHjFqawdExiSH7dAwmDDYuX9fcPpx6xKL/ilvyUuSrKIm9Q1Ql0kIjRTvDkJsj9i2jofZZOLK3yMNWRSg70KBv/Ki0=
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_MN2PR00MB0688661C391F3234CBFB9812F58A0MN2PR00MB0688namp_"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: MN2PR00MB0688.namprd00.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 10c599ea-cf9f-4e9e-f4d6-08d8065f9547
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Jun 2020 19:11:26.8209 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: WRluydHyo7GEp5ged5ulKUB0CA8BZy6YxfvtFZDwjreHE5B4U9za7xDqw4JsTfGh7zKb8b5DmcB78xWloqoSHQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR00MB0323
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/LhG-oLiE3Px9GHq9G_OHT5sCLOU>
Subject: Re: [OAUTH-WG] Downgrade attacks on PKCE
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: Mon, 01 Jun 2020 19:11:39 -0000

Like Filip and Neil and I believe Ryan, I prefer the dynamic option 2.  It keeps existing clients working when possible, which should be a goal of OAuth 2.1.

                                                       Thanks,
                                                       -- Mike

From: Dick Hardt <dick.hardt@gmail.com>
Sent: Monday, June 1, 2020 10:54 AM
To: Neil Madden <neil.madden@forgerock.com>
Cc: Daniel Fett <fett@danielfett.de>de>; oauth@ietf.org; Mike Jones <Michael.Jones@microsoft.com>
Subject: Re: [OAUTH-WG] Downgrade attacks on PKCE

Mike: what are your thoughts on the options?
ᐧ

On Sat, May 30, 2020 at 4:39 AM Neil Madden <neil.madden@forgerock.com<mailto:neil.madden@forgerock.com>> wrote:
We (ForgeRock) already support solution 1 as a configuration option, but I prefer solution 2 and have raised a ticket for us to implement it. For us at least it’s a trivial fix and seems more robust against configuration errors.

— Neil


On 30 May 2020, at 08:58, Daniel Fett <fett@danielfett.de<mailto:fett@danielfett.de>> wrote:

Hi all,

Aaron, Dick, Torsten and I today discussed the downgrade attacks on PKCE [1] and how to mitigate them in OAuth 2.1 and 2.0. We came to the conclusion that we have two options:

1. "Static" Solution

For every client_id that is registered with an AS, the AS MUST either always enforce the use of PKCE or always enforce the use of nonce. Whether PKCE or nonce is enforced can be part of the client registration or configured in other ways.

In other words: A single client is not allowed to switch between using PKCE and using nonce.

Note that the client is allowed to use the respective other mechanism on top of the enforced one.

Properties:

  *   Easy to understand mitigation.
  *   Implementation is mainly a new data field and a check in the authorization request.
  *   Not compatible to deployments where clients sometimes use nonce and sometimes use PKCE with the same client_id.

2. "Dynamic" Solution

Each AS that supports PKCE MUST check whether a code challenge is contained in the authorization request. This information MUST be bound to the code that is issued.

When a code arrives at the token endpoint, the AS MUST do the following check:

  1.  If there was a code_challenge in the authorization request for which this code was issued, there must be a code_verifier in the token request and it must be verified according to RFC7636. (This is no change from the current behavior in RFC7636.)
  2.  If there was no code_challenge in the authorization request, any request to the token endpoint containing a code_verifier MUST be rejected.

Properties:

  *   No change in behavior needed for properly implemented clients. Backwards compatible for all existing deployments.
  *   Implementation is mainly some logic for the authorization endpoint, token endpoint, and a new data field in the authorization session maintained by the AS.
  *   Slightly more complex to implement for the AS, maybe.
We would like to hear the feedback from the working group on these two solutions before proceeding to propose wording for the affected documents.

[1] https://danielfett.de/2020/05/16/pkce-vs-nonce-equivalent-or-not/

-Daniel

_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth

_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth