Re: [OAUTH-WG] [EXTERNAL] Re: Authorization code reuse and OAuth 2.1

Pieter Kasselman <pieter.kasselman@microsoft.com> Fri, 15 October 2021 09:04 UTC

Return-Path: <pieter.kasselman@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 E8D393A18C2 for <oauth@ietfa.amsl.com>; Fri, 15 Oct 2021 02:04:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.452
X-Spam-Level:
X-Spam-Status: No, score=-2.452 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.452, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=0.1, RCVD_IN_MSPIKE_H2=-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 is-SOBkpud71 for <oauth@ietfa.amsl.com>; Fri, 15 Oct 2021 02:04:45 -0700 (PDT)
Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140098.outbound.protection.outlook.com [40.107.14.98]) (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 49BB63A18BB for <oauth@ietf.org>; Fri, 15 Oct 2021 02:04:44 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KsbSHhrnYn74i2Do7z7ELtp5dBXENK4JYodLACjMPrdEI+M9hVH1R4OhqlNomAJg8Ei4nBs49q0/A95V2vo97vg78yq69NtI0ZBljknJrP5dkw2rqggVIB7MKymiMwZhBKgy8js0WP5lJOmfvtrpdop+4QkBxUUPUurO604QjSlIyYvUXYzhdKI/ED0B16CW8a+a7Z3gCxHnKwLoBuF/LAxehAjkhjtar6dOjgAmwjdGoOutUz15B8qZYOcYj9FZ5d0o+sFn031TXyrA4qvXJKgo1Llbh5Xl+ckXHBwCqudzbyENogY9IPV1gfZN8OXwXuXEBRor1u2NM2Nd83brhw==
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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DufVLU+2aMjwOqyrxYHKrFFgVYpA8W085Mc/TTltH+0=; b=KDWy+8stWGe3rf3HE7sbaeGBqRO+Wx4h877TiFyUllbW7cP/foLuWENKBEWHyHcmcgXKH1upiVAMNwmbW/xq5Qtz7UNFCF1jel9NaOBf5yczeC52cHisQyzWdL4Pyf9ZYS/ey5VVPtJv/wNM215XeEO6GDvmvJnRBcsSE7+7fnxW2BcjdJQZ6FmdPDADp1rc7+2QX0cj6P6qiiKyKh7xRTU4V7xvsbsPx26xSjNjokxh7amSVdvy81Bs6+GuZobXboA0vZhsM0Kbp2DMWaYTgHfHEcSlCBRFanHaXi1BcRDWM2f7vQkv7OHqbTzJbPbbau6gPRUmecgR9FMN2DyO0A==
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=DufVLU+2aMjwOqyrxYHKrFFgVYpA8W085Mc/TTltH+0=; b=h5R+0myUsoTa2i6pJO4zVQs7YFCIXNuvIwiEHs9VBABh5vCNGhSYGeMCaqxfX7+fA4D9C8ayudpQY8O+CKWyEZGO0QkhJe2GW2zgo1tba7W0EdFF36ABThjhwsg27PW5PDxPSVsxBqWLhQZ3NYoNP+iTxPsYuW6KbGdtjN/CbRY=
Received: from AM7PR83MB0452.EURPRD83.prod.outlook.com (2603:10a6:20b:1b6::10) by AM6PR83MB0263.EURPRD83.prod.outlook.com (2603:10a6:209:6a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.3; Fri, 15 Oct 2021 09:04:39 +0000
Received: from AM7PR83MB0452.EURPRD83.prod.outlook.com ([fe80::e00b:f459:6dd3:4d24]) by AM7PR83MB0452.EURPRD83.prod.outlook.com ([fe80::e00b:f459:6dd3:4d24%3]) with mapi id 15.20.4628.011; Fri, 15 Oct 2021 09:04:39 +0000
From: Pieter Kasselman <pieter.kasselman@microsoft.com>
To: Warren Parad <wparad=40rhosys.ch@dmarc.ietf.org>, Pieter Kasselman <pieter.kasselman=40microsoft.com@dmarc.ietf.org>
CC: IETF oauth WG <oauth@ietf.org>
Thread-Topic: [OAUTH-WG] [EXTERNAL] Re: Authorization code reuse and OAuth 2.1
Thread-Index: AQHXwHP9h13QsTp2FU6wELe/QeAi06vRaKEAgAAC0ACAAACQAIAAB5kAgAHI24CAAHvi4IAAAu4AgAAKDLA=
Date: Fri, 15 Oct 2021 09:04:38 +0000
Message-ID: <AM7PR83MB045240CC8FECB49C25E47DE491B99@AM7PR83MB0452.EURPRD83.prod.outlook.com>
References: <SA2PR00MB100244DAAD267EBD2FF51678F5B79@SA2PR00MB1002.namprd00.prod.outlook.com> <CAJot-L1HNvud7-ehODK7Bouv5-KotMy8EtEgLCyCzOXoSZCVCg@mail.gmail.com> <CAGBSGjpJrM4uUTdVvsEzh5sT0H9ZpEJ0D3yfo-p_1S9w_tdF8g@mail.gmail.com> <AM7PR83MB0452A256F01A7DE8BE65C98C91B79@AM7PR83MB0452.EURPRD83.prod.outlook.com> <CAGBSGjoNoHybJNZaxdFs2Z9D+rUi+zORzt9v_f0cdhYZaj=KcA@mail.gmail.com> <CAJot-L30=scUs0yon4fx_Ti6Sq8gW4xy758j2qGLR_Cg2R-82Q@mail.gmail.com> <CAGBSGjoGhoz203+sXOGtDLr14DJLsRhjEd1uA==7SNLNRZdzpQ@mail.gmail.com> <CAP=vD9tOAxCAKumBcNkK077jMiWC+r7xBgu46oCFPgJPsu2EnQ@mail.gmail.com> <CAGBSGjpg63Rq2eEh3v3vAS=cuN3eNXAycbAOokaDg6v74saRHQ@mail.gmail.com> <CAP=vD9tKaSt2p_8_Ltcc7Ad5v5Yq6ST-tmf-VM6iKbXgZyP48A@mail.gmail.com> <AM7PR83MB04525DD2AE371CC6DE966CCB91B79@AM7PR83MB0452.EURPRD83.prod.outlook.com> <CAGBSGjoEOvB0FPXLhqnq5WzOmRd_JTDyj2E06kuqv=b9c7W=dA@mail.gmail.com> <CAFvbn=ZMUfsghP8Nc55zRkodn2vvXeMGd7VLaN7LAL2b6M0UfQ@mail.gmail.com> <AM7PR83MB0452B1DE01554322C87B07C791B99@AM7PR83MB0452.EURPRD83.prod.outlook.com> <CAJot-L3fFpu-84B255GhKHXfZfxVqQDpTyTcTP9BYhBhC=GHcA@mail.gmail.com>
In-Reply-To: <CAJot-L3fFpu-84B255GhKHXfZfxVqQDpTyTcTP9BYhBhC=GHcA@mail.gmail.com>
Accept-Language: en-IE, en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2021-10-15T09:04:36Z; 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_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=0f0903db-5d4e-4c28-968f-f242a5080dc4; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: d47b559f-5855-4221-c18d-08d98fbad171
x-ms-traffictypediagnostic: AM6PR83MB0263:
x-microsoft-antispam-prvs: <AM6PR83MB0263EC7813864FEAA6B64C2591B99@AM6PR83MB0263.EURPRD83.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: 8w1SNZsEDT5jIM5aBDh5se1WrXiepzPmB3yOlKpvYMicvAi/OUUnrA/b2Sm+jTKSFmp2Lp5V/bPWH8iBrRQc3D+6Y1cbXHB2s2618nP4Jwao8l2Pd3a1Xuu1+sy4SODAbvH4U4kw6MIzt+8Nu6CD30vsflNBXE9KZBCjCjWvdnMKkgdUNRquzBfgrczhxcrm2enBjbmkQUn632wikqu8aojztkBlwPP8mTv051sHMJzXbZOxofDLeob22DX7K3AMuEDxChJXybrTzdyFQPcEy0nkjt2uqVi0olys/leUUmK6XBC0NxqiNALJrRGVL7gOC4/jOKYucgpMlsjEwS4Y897Z9ZDe76uw0uN2nd09KGEQ/5gcX+pr5YMixgpaEWIkOtYwa3dBIWgyfyfcl+wqmPR1isWKhl0LlKnWEfbUM6Ldppxde8aWkPO8FMcbLXyHt77xLVEXSsDvY+o+M0xWS2BMliyGtmS9oh4AtMqHzvxeK1vIbNikhy3n+xj+gbVIdm4FMuRj/50vTtfZ9EDg6G+4FweI7beSwz/fd3eFXH5/m+GzlsnN/w0ha5ew0Q75rtt/cfQLBkAqDlpnhyeK3dXLW8wMo29rt+50WI+SJdz+wD0LbdaEb+qI+MrI110wPCC99rnUZ+BB5s1EYUpQsWe2xNd7zVwzUPVdflCcaBRxl9+nocwfTxESvdbi2+uoFfdmXEpqzg5CU0R7Gz+fxRRZVqIfUoSQ9H6IcDLmDzfLu7c6LeWgPq84V35kZWnVy5q8HPWHCYmNnN+w8Wifh7fUbKylmNOEZ1rh+2RtcXFm4Ku+GsDqd+nJ3m2/BDUt
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR83MB0452.EURPRD83.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(83380400001)(66476007)(66946007)(66556008)(33656002)(166002)(38100700002)(64756008)(38070700005)(66446008)(52536014)(10290500003)(8676002)(66574015)(99936003)(82950400001)(82960400001)(30864003)(966005)(4326008)(76116006)(55016002)(508600001)(2906002)(44832011)(86362001)(7696005)(122000001)(9686003)(53546011)(5660300002)(110136005)(8936002)(8990500004)(6506007)(186003)(316002)(71200400001)(579004)(10090945008); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 8rP5/SgrXqTV74w7oJ/CRK563VQ/+EQyUywi01mMF6I/VojUhSMJLQnff3IGE8wJ9tubF3SXhUvTHRxhtG6eKg+XPHevUsD2Fu+xOfjTHblg2Oo2nPW2WahGafLTEBQoc1HFar/6ZiVu2tzJE/jF0FR8sEU4O2fqFGyQ0awaxiVaqUxdI2GXo8Gn5rkTTVpIIJT91uUwbeckUMNY46qTGTbHrw4KP8bDxEh2AIYsCbwG53gN3loGv4nRtlmF4Q8d/lPqnnEUZycWFd5bwMkpuVjYUIxIJmmxvwlziICYwtmwB5n5vnGAtbI+pbQON4MXEEWjGCtuGQ3NId+V1j3Mo9GLnEcL8P3PyZb82VGSuJoZsr1g0TXs2gBodQ8L+a/wsjVE2ruZcQ1CVyuF9dsnDkK/y8wI9nH70osldZsWwkarbv55YSpwNW6MsI+/fqk6SJoWru63fHpa5eb6463cfZwUWL7rydcwCbCBv1ATQGK/NfuLo0+cCa5kvJuu711ObVFsd1IHIxYYsP//wU1TuVsBOSDPlPvszZ1+OLU0BHz9zqYVUSyq74vcrjPpGoe1sQqcEhliO+CvwtOvLLcONS7io/+YpFt7iqK93/0AYJKNe3cZ4GuVwI98+Asta3lnF2CEj15bhlrwfbrL6x+1xzMEm5dMJIcjEuwdrgoLUovgXO9YiJKulx54va9jU5DJICzOJal8qomAw03GWG796kfIsvIszGL9QEiDAdUbHo96KFzDdAW2U6by5KdykU5St2KQ+35zfkdaZVsXyISkxPLCORX1z2/4nPxmN9I5Lzw5y4XArewbDWAXrQ+cKAnou3Hwwz6ig3A5e3Kqo4tBgssJRATVP7SX4xqb0gzGNZ/j5gsa3ZoO+VcEuIyW3LgNT+jhIiVeoAQuUHsHGWRdCRkH0H497gJDH218Bq3LTFJ0nHI7lTlgFQirKPFnpfB/afTO/Agcz5wAv57qynIU5RfWusa/uympHsV73F2WOhGSlajVXlHxoZYx9Q8YScUybjj8po4oIe9wkAILQzaPaDsifaSNXGILemVtPwXXnDtH7XP9PW47o6xWfAkcsg2JIK6obv9d6IYMNRlE9gbpcyZ2cGrv7N7Xo2a2ufWVoVGk3A2RPAb0Odmi7OU3eXVGeiIFWYjmMHbq+51+rXWL7eCpL/MQ8wL5aJfk1gw8Y1Lz1G8lyQH/fNtLy4JKtWso5eKTtFg4XDiNJ/rVm9CE6YysdGOb94KPztjrRbmS2etR1z6HDWzx2n5N5qfS0ysdt7j5nmZM++d3fkH2fXQw120z0J2vR+flpOGqZpl8tkq6tVzklNf37pZTajI5XgoeQgtC2eEPATjDe9c+5W8B/1Lb/A+sLZ50lgoq0tHiHJPRMyXxXdxe58UvctTs0xBsWXe7o/E4tFykQgC25IbTtuQFN4LNPvokikkaCufKVna0O7Eb8bkbXvRXDFSsq+B74zTzIl6oFT56KBE7NAOHUav3bybcpGwlzziKKfq9apYlr0wOlXCYb5uah17X6twzm1pzrQFPm1irWioz7e08zJDf+Ey1iXfFU98cAdmKl85lYbZi5H3TQk4skwn5EA4PoiSZyQYledLVmGThg6CNC1noj7xKT399YYCNq+XyWEd8kZI7nRtwoIC6tDDDebDLdklPcoEXKHwJ3XBsWXdwCQ==
Content-Type: multipart/related; boundary="_004_AM7PR83MB045240CC8FECB49C25E47DE491B99AM7PR83MB0452EURP_"; type="multipart/alternative"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM7PR83MB0452.EURPRD83.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d47b559f-5855-4221-c18d-08d98fbad171
X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2021 09:04:38.8684 (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: ooFAeUskFteEEm9m13cTW1gPTtbw5jwR1ZvCXAO/WxCsaOneUAzlrL57K9/JpOrycGMlKAJKF6V/Xe8ixYXBPBDLOR103Tl3Q2LiTrahjrw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR83MB0263
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/KiVdppYxESdPfBty3kpLc21Mtec>
Subject: Re: [OAUTH-WG] [EXTERNAL] Re: Authorization code reuse and OAuth 2.1
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: Fri, 15 Oct 2021 09:04:53 -0000

SHOULD is more likely to cause the right conversations to take place for implementors as they weigh the risks. Reducing it to MAY risks diluting it too much.

From: OAuth <oauth-bounces@ietf.org> On Behalf Of Warren Parad
Sent: Friday 15 October 2021 09:25
To: Pieter Kasselman <pieter.kasselman=40microsoft.com@dmarc.ietf.org>
Cc: IETF oauth WG <oauth@ietf.org>
Subject: Re: [OAUTH-WG] [EXTERNAL] Re: Authorization code reuse and OAuth 2.1

I wouldn't be against lowering it to MAY but only if we stipulate a SHOULD on an expected lifetime of an authorization code. I think sending the message that these should be one time use except in exceptional circumstances.


[https://lh6.googleusercontent.com/DNiDx1QGIrSqMPKDN1oKevxYuyVRXsqhXdfZOsW56Rf2A74mUKbAPtrJSNw4qynkSjoltWkPYdBhaZJg1BO45YOc1xs6r9KJ1fYsNHogY-nh6hjuIm9GCeBRRzrSc8kWcUSNtuA]

Warren Parad

Founder, CTO
Secure your user data with IAM authorization as a service. Implement Authress<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fauthress.io%2F&data=04%7C01%7Cpieter.kasselman%40microsoft.com%7C0d1e820fa1664a5bb1ab08d98fb54d4f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637698831154740432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=6rSI2UvnakrWNh3qtBEgIMbRO8L9oXu8zGj4Fd128B8%3D&reserved=0>.


On Fri, Oct 15, 2021 at 10:17 AM Pieter Kasselman <pieter.kasselman=40microsoft.com@dmarc.ietf.org<mailto:40microsoft.com@dmarc.ietf.org>> wrote:
Any weakening of the requirement should include a clear outline of the risks to help implementors make informed decisions.

From: OAuth <oauth-bounces@ietf.org<mailto:oauth-bounces@ietf.org>> On Behalf Of Ash Narayanan
Sent: Friday 15 October 2021 01:51
To: Aaron Parecki <aaron@parecki.com<mailto:aaron@parecki.com>>
Cc: IETF oauth WG <oauth@ietf.org<mailto:oauth@ietf.org>>
Subject: Re: [OAUTH-WG] [EXTERNAL] Re: Authorization code reuse and OAuth 2.1

You don't often get email from ashvinnarayanan@gmail.com<mailto:ashvinnarayanan@gmail.com>. Learn why this is important<http://aka.ms/LearnAboutSenderIdentification>
Yes, as I said before, authorization servers are free to enforce one-time use of the authorization code even if there isn't a requirement to. The proposal is just to remove the *requirement* of authorization servers enforcing it.

I agree, and therefore I think what it really ought to be is "MAY".

Annabelle said:
There are legitimate use cases for a client to replay an authorization code. Connection failures happen. Servers fall over before completing requests. Users hit browser refresh buttons. Permitting replay of authorization codes (assuming valid PKCE, client creds, etc.) allows clients to handle these failure modes simply and gracefully via retries.

Couldn't agree more. Having experienced these exact use-cases, I can honestly say that denying users a smooth experience just to be compliant with the spec, which offers no additional security if PKCE is also being used, makes no sense.
It is also more effort (from a repository layer perspective) to implement one-time use than do PKCE verification.

What is the practical reason for allowing "plain" PKCE in OAuth 2.1? Are there really use cases out there where SHA-256 is a deal breaker?

I'd be interested in these use-cases as well (I can't think of any).

On Thu, Oct 14, 2021 at 8:36 AM Aaron Parecki <aaron@parecki.com<mailto:aaron@parecki.com>> wrote:
Yes, as I said before, authorization servers are free to enforce one-time use of the authorization code even if there isn't a requirement to. The proposal is just to remove the *requirement* of authorization servers enforcing it.

I am okay with Mike's suggestion of changing the language to "SHOULD" to continue to point out the possibility of enforcing one-time authorization codes if desired.



On Wed, Oct 13, 2021 at 2:15 PM Pieter Kasselman <pieter.kasselman@microsoft.com<mailto:pieter.kasselman@microsoft.com>> wrote:
Log files can exist in lots of place (clients, servers, data lakes). The question is whether it is a valid assumption that an attacker cannot obtain an Authorization Code and a Code Verifier and present it a second time round. Limiting the validity period is one layer of defence, PKCE is another layer, one time use enforcement is another. Assuming breach and designing from a defence in depth perspective is a good practice, so why not give implementors options (and guidance) to add additional layers of defence to match their risk profiles?


From: OAuth <oauth-bounces@ietf.org<mailto:oauth-bounces@ietf.org>> On Behalf Of Sascha Preibisch
Sent: Wednesday 13 October 2021 22:06
To: Aaron Parecki <aaron@parecki.com<mailto:aaron@parecki.com>>
Cc: IETF oauth WG <oauth@ietf.org<mailto:oauth@ietf.org>>
Subject: Re: [OAUTH-WG] [EXTERNAL] Re: Authorization code reuse and OAuth 2.1

Ok, if the goal is to avoid unnecessary requirements I am suggesting to point out why MUST was changed to SHOULD. Otherwise developers will start to mix and match OAuth 2.0 and OAuth 2.1 requirements as they see them fit their needs.
In regards to encrypted values in PKCE, Aaron, I can also not confirm that as the general implementation.

On Wed, 13 Oct 2021 at 13:56, Aaron Parecki <aaron@parecki.com<mailto:aaron@parecki.com>> wrote:
The PKCE spec actually says "Typically, the "code_challenge" and "code_challenge_method" values are stored in encrypted form in the "code" itself" which I feel like might be a stretch to say that's typical, but this scenario was clearly thought of ahead of time. Doing that would enable an AS to avoid storing server-side state.

On Wed, Oct 13, 2021 at 1:50 PM Sascha Preibisch <saschapreibisch@gmail.com<mailto:saschapreibisch@gmail.com>> wrote:
If the challenge is based on distributed authorization server configurations, how would they handle PKCE? I imagine that managing the state for PKCE is not less challenging than managing authorization codes on the server side, preventing reuse of them.
With that in mind I am not sure if I follow the given argument. I would prefer to keep MUST as it is today.


On Wed, 13 Oct 2021 at 13:37, Aaron Parecki <aaron@parecki.com<mailto:aaron@parecki.com>> wrote:
HTTPS, because if that's broken then the rest of OAuth falls apart too.

On Wed, Oct 13, 2021 at 1:36 PM Warren Parad <wparad@rhosys.ch<mailto:wparad@rhosys.ch>> wrote:
I feel like I'm missing something, what stops just plain old network sniffing and replying the whole encrypted payload to the AS and getting back a valid token?


[Image removed by sender.]

Warren Parad

Founder, CTO
Secure your user data with IAM authorization as a service. Implement Authress<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fauthress.io%2F&data=04%7C01%7Cpieter.kasselman%40microsoft.com%7C0d1e820fa1664a5bb1ab08d98fb54d4f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637698831154750385%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=y86Gy8RiRIbIAW3So8hr4PxYsta1VWX1X7l%2FHzVbcvI%3D&reserved=0>.


On Wed, Oct 13, 2021 at 10:33 PM Aaron Parecki <aaron@parecki.com<mailto:aaron@parecki.com>> wrote:
Aside from the "plain" method, the PKCE code verifier never leaves the client until it's sent along with the authorization code in the POST request to the token endpoint. The only place it can leak at that point is if the authorization server itself leaks it. If you have things leaking from the authorization server log, you likely have much bigger problems than authorization code replays.

Keep in mind that even with the proposed change to drop the requirement of authorization codes being one time use, authorization servers are free to enforce this still if they want. Authorization code lifetimes are still expected to be short lived as well.

Aaron


On Wed, Oct 13, 2021 at 1:25 PM Pieter Kasselman <pieter.kasselman@microsoft.com<mailto:pieter.kasselman@microsoft.com>> wrote:
Aaron, I was curious what prevents an attacker from presenting an Authorization Code and a PKCE Code Verifier for a second time if the one time use requirement is removed. Is there another countermeasure in  PKCE that would prevent it? For example, an attacker may obtain the Authorization Code and the Code Verifier from a log and replay it.

Cheers

Pieter

From: OAuth <oauth-bounces@ietf.org<mailto:oauth-bounces@ietf.org>> On Behalf Of Aaron Parecki
Sent: Wednesday 13 October 2021 18:40
To: Warren Parad <wparad=40rhosys.ch@dmarc.ietf.org<mailto:40rhosys.ch@dmarc.ietf.org>>
Cc: Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org<mailto:40microsoft.com@dmarc.ietf.org>>; oauth@ietf.org<mailto:oauth@ietf.org>
Subject: [EXTERNAL] Re: [OAUTH-WG] Authorization code reuse and OAuth 2.1

Warren, I didn't see you on the interim call, so you might be missing some context.

The issue that was discussed is that using PKCE already provides all the security benefit that is gained by enforcing single-use authorization codes. Therefore, requiring that they are single-use isn't necessary as it doesn't provide any additional benefit.

If anyone can think of a possible attack by allowing authorization codes to be reused *even with a valid PKCE code verifier* then that would warrant keeping this requirement.

---
Aaron Parecki


On Wed, Oct 13, 2021 at 10:27 AM Warren Parad <wparad=40rhosys.ch@dmarc.ietf.org<mailto:40rhosys.ch@dmarc.ietf.org>> wrote:
Isn't it better for it to be worded as we want it to be, with the implication being that of course it might be difficult to do that, but that AS devs will think long and hard about sometimes not denying the request? Even with MUST, some AS will still allow reuse of auth codes. Isn't that better than flat out saying: sure, there's a valid reason

In other words, how do we think about RFCs? Do they exist to be followed to the letter or not at all? Or do they exist to stipulate this is the way, but acknowledge that not everyone will build a solution that holds them as law.

Let's look at SHOULD
This word, or the adjective "RECOMMENDED", mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.

I think recommended here is not sufficient nor are there valid reasons. "It's too hard" isn't really a valid reason. Isn't it better in this case for an AS to not be compliant with the RFC, than it is to relax this to SHOULD and have lots of AS thinking reusing auth codes is a viable solution, "because they are a special snowflake where SHOULD should apply".

Are we setting the standard or instead attempting to sustain a number of "AS that are in compliance with the RFC"?


[Image removed by sender.]

Warren Parad

Founder, CTO
Secure your user data with IAM authorization as a service. Implement Authress<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fauthress.io%2F&data=04%7C01%7Cpieter.kasselman%40microsoft.com%7C0d1e820fa1664a5bb1ab08d98fb54d4f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637698831154760332%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=lbb9cJl0VUcfBD9IwzKF4BeB5nnggZxLB1TwlZYdNK4%3D&reserved=0>.


On Wed, Oct 13, 2021 at 7:17 PM Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org<mailto:40microsoft.com@dmarc.ietf.org>> wrote:
During today's call, it was asked whether we should drop the OAuth 2.0 language that:
         The client MUST NOT use the authorization code
         more than once.  If an authorization code is used more than
         once, the authorization server MUST deny the request and SHOULD
         revoke (when possible) all tokens previously issued based on
         that authorization code."

The rationale given was that enforcing one-time use is impractical in distributed authorization server deployments.

Thinking about this some more, at most, we should relax this to:
         The client MUST NOT use the authorization code
         more than once.  If an authorization code is used more than
         once, the authorization server SHOULD deny the request and SHOULD
         revoke (when possible) all tokens previously issued based on
         that authorization code."

In short, it should remain illegal for the client to try to reuse the authorization code.  We can relax the MUST to SHOULD in the server requirements in recognition of the difficulty of enforcing the MUST.

Code reuse is part of some attack scenarios.  We must not sanction it.

                                                          -- Mike

_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Foauth&data=04%7C01%7Cpieter.kasselman%40microsoft.com%7C0d1e820fa1664a5bb1ab08d98fb54d4f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637698831154760332%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=u3yNDEeIsFvqGwu3x8%2F22D25o3bVO9PkrBEA2IEKSzY%3D&reserved=0>
_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Foauth&data=04%7C01%7Cpieter.kasselman%40microsoft.com%7C0d1e820fa1664a5bb1ab08d98fb54d4f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637698831154770299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7JX5eYOgW7gjFIIySrFurb2%2B9dBhH4IAsXhIMkV%2FGps%3D&reserved=0>
_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Foauth&data=04%7C01%7Cpieter.kasselman%40microsoft.com%7C0d1e820fa1664a5bb1ab08d98fb54d4f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637698831154770299%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=7JX5eYOgW7gjFIIySrFurb2%2B9dBhH4IAsXhIMkV%2FGps%3D&reserved=0>
_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Foauth&data=04%7C01%7Cpieter.kasselman%40microsoft.com%7C0d1e820fa1664a5bb1ab08d98fb54d4f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637698831154780256%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=lJqE32wIC4OoFoYfUMYr8zd3pgEz2abBr2aga42rFsA%3D&reserved=0>
_______________________________________________
OAuth mailing list
OAuth@ietf.org<mailto:OAuth@ietf.org>
https://www.ietf.org/mailman/listinfo/oauth<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf.org%2Fmailman%2Flistinfo%2Foauth&data=04%7C01%7Cpieter.kasselman%40microsoft.com%7C0d1e820fa1664a5bb1ab08d98fb54d4f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637698831154780256%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=lJqE32wIC4OoFoYfUMYr8zd3pgEz2abBr2aga42rFsA%3D&reserved=0>