Re: [OAUTH-WG] Cookies & headers in OAuth 2.0 Security Best Current Practice?

Dick Hardt <dick.hardt@gmail.com> Sun, 05 November 2023 19:29 UTC

Return-Path: <dick.hardt@gmail.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 96EAFC05E045 for <oauth@ietfa.amsl.com>; Sun, 5 Nov 2023 11:29:31 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.105
X-Spam-Level:
X-Spam-Status: No, score=-7.105 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zkjYjU-4pxuP for <oauth@ietfa.amsl.com>; Sun, 5 Nov 2023 11:29:30 -0800 (PST)
Received: from mail-yw1-x112d.google.com (mail-yw1-x112d.google.com [IPv6:2607:f8b0:4864:20::112d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CCBB5C151984 for <oauth@ietf.org>; Sun, 5 Nov 2023 11:29:30 -0800 (PST)
Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-5afabb23900so45153677b3.2 for <oauth@ietf.org>; Sun, 05 Nov 2023 11:29:30 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699212570; x=1699817370; darn=ietf.org; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DS4W67Z74CZxAtnNXnqP5ZyuJiWsce6ZAPVgRiHMpA8=; b=FxcVzT2mn25sFEA0FSzV6tUGoZpeC/rx8KFEFrBCtzKrTbE/6GGz0FvzTfXdNizqkh AV6zcOSkxVyY67rdMiNlE+JwHjbFCCeC+lQPK7AGbgDxx7fecmMABgkdmKn3dlF1VdIA +cv3023hX/CMu+xX23fjSaBFy3o2TwwRP+ehUXrQ6REsUaBQfYgDb7E/lRhqG6UuJrXK fLzEul8tv0tTWWdOayYNPcjfYlAMITAKEFlxci7ifjcjW7IlOsUUhUayq38u8G/9aWUQ Zo0OUAlFVKcg41j1+ZVc5yBGf17lD29HF1yHW5RFHytCsuZguStfEl07ZNQgaD6Zxa4P BUKA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699212570; x=1699817370; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DS4W67Z74CZxAtnNXnqP5ZyuJiWsce6ZAPVgRiHMpA8=; b=Asgfl0HdeyWLdnVKlzxdT2LU/R6Tx4b2dLv8/UXkHICJA3oe2c9k5uugpOnb/SS0Va kEobVHq5F/JDhFgvL4+5J80PsjjT+/rHNyvvkhgY2pe05vJUrjoFzyidhgLm7Xd16rkZ 5EkwGfe1J+fqyeaz3NErrfUY0ndICXIKDjpPvFhUaxuMxYAKXj8794tkXKs+6qRn4ceI muAoxstwljHvF5DYnj3Ag8fo+bdr4lbACjq+AHxRHHdD0C6+WywQu7gAjIP3FAF0zHAF 5XoPfjkodohzt5E8yulFknNGHAL9tw3qRz0vLIoUw9+JqkyW/NrNniZluicacFqw8D9V cLyw==
X-Gm-Message-State: AOJu0YxIEOKW9+EDBvGGpoFPBLlrLidHU+qQktWPM05pgyvXm1ad0zwE x5iiwyi1l0XO7cqRztEdK/lJMYVa5QIwb6QfDmums7euumU=
X-Google-Smtp-Source: AGHT+IGlg2UryjCtuED1CQ012Qop2f6SYQ7QmCeWVIwDkBE3BYWP/Ajwac9QZnf8ZNUfs8TSIFEzdpckgIfZ86BBoOQ=
X-Received: by 2002:a0d:e8c3:0:b0:59b:14ca:4316 with SMTP id r186-20020a0de8c3000000b0059b14ca4316mr9190665ywe.43.1699212569672; Sun, 05 Nov 2023 11:29:29 -0800 (PST)
MIME-Version: 1.0
References: <CAD9ie-sh0qnGzg5VwU_enq2Br9hH5zgm86z9i7vdMj_uQs=4yA@mail.gmail.com> <CAGBSGjrMDrXMd2ApKmLn_LVgMSLME-wvHqPCTpzgDxk5_+kRSA@mail.gmail.com> <f6383d62-9586-49c9-a824-9d92288ee4bd@danielfett.de> <CAGBSGjqe2HjJuh6OgJy5VU+w8HRyu159uJtMnmXS+LPWg_LphA@mail.gmail.com>
In-Reply-To: <CAGBSGjqe2HjJuh6OgJy5VU+w8HRyu159uJtMnmXS+LPWg_LphA@mail.gmail.com>
Reply-To: Dick.Hardt@gmail.com
From: Dick Hardt <dick.hardt@gmail.com>
Date: Sun, 05 Nov 2023 11:28:53 -0800
Message-ID: <CAD9ie-sfrzEMvS8yk49XSNfvwRbcj1tPKfmNxC97VAF4pRqcfg@mail.gmail.com>
To: Aaron Parecki <aaron=40parecki.com@dmarc.ietf.org>
Cc: Daniel Fett <fett=40danielfett.de@dmarc.ietf.org>, oauth@ietf.org
Content-Type: multipart/alternative; boundary="0000000000009d001f06096cc167"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/hpFzD3gWIrKBY9yknBXcbMkS67k>
Subject: Re: [OAUTH-WG] Cookies & headers in OAuth 2.0 Security Best Current Practice?
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.39
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: Sun, 05 Nov 2023 19:29:31 -0000

The cookie and header recommendations I am thinking of would be for the AS
as well as the client.

A number of XSS attacks can be thwarted by a modern browser and the right
HTTP headers.

My question is: Did the authors consider adding cookie and header
recommendations, and decided it was too general?

Cookie and header best security practices have been around for years -- I'm
not suggesting we make anything up -- I'm suggesting we raise awareness.

I consider myself to be fairly security aware, and I was not aware of some
of the HTTP headers that are best security practice.

/Dick


On Sun, Nov 5, 2023 at 11:19 AM Aaron Parecki <aaron=
40parecki.com@dmarc.ietf.org> wrote:

> I don't think it's necessary to say "do the right things with cookies" in
> the Security BCP. The Browser Apps BCP has a much deeper discussion of how
> different browser-based architectures work with cookies so that seems like
> a better place to actually have a real discussion about it.
>
> Also +1 to what Daniel said about not continuing to add little things.
> Plus I think it's too late anyway, publication has already been requested
> for the Security BCP.
>
> Aaron
>
> On Sun, Nov 5, 2023 at 11:14 AM Daniel Fett <fett=
> 40danielfett.de@dmarc.ietf.org> wrote:
>
>> I agree with Aaron!
>>
>> Also we should be very careful about any additions to the Security BCP at
>> this point. It is very easy to re-start the "one more thing" loop we've
>> been stuck in for the last years. There may be more useful things to say,
>> but we should put them on the list for a future second version of the BCP.
>>
>> -Daniel
>> Am 05.11.23 um 20:03 schrieb Aaron Parecki:
>>
>> I don't think the Security BCP should incorporate cookie best practices
>> directly in the document. If anything, it sounds like possibly a candidate
>> for inclusion in the Browser Apps BCP.
>>
>> There are already some mentions of these cookie properties mentioned in
>> the Browser Apps BCP, though only in reference to specific architectures,
>> not as a general best practice. For example:
>>
>>
>> https://www.ietf.org/archive/id/draft-ietf-oauth-browser-based-apps-15.html#pattern-bff-cookie-security
>>
>> Aaron
>>
>> On Sun, Nov 5, 2023 at 10:48 AM Dick Hardt <dick.hardt@gmail.com> wrote:
>>
>>> Hey
>>>
>>> I was reviewing security on some sites I managed and checked to see if
>>> the recommendations were in the BCP.
>>>
>>> I don't see anything around cookies such as httpOnly, sameSite, secure.
>>>
>>> I saw some HTTP security header suggestions buried in 4.16
>>> (X-Frame-Options, CSP), but not for Strict-Transport-Security,
>>> Permissions-Policy, or X-Content-Type-Options, and the CSP guidance is
>>> rather vague.
>>>
>>> I understand these are general web security best practices, and perhaps
>>> I missed it, but I think it would be useful to call out that best security
>>> practices around cookies and headers should also be followed in Section 2,
>>> and either have the best practices included, or direct the reader where to
>>> find them.
>>>
>>> /Dick
>>>
>>> _______________________________________________
>>> OAuth mailing list
>>> OAuth@ietf.org
>>> https://www.ietf.org/mailman/listinfo/oauth
>>>
>>
>> _______________________________________________
>> OAuth mailing listOAuth@ietf.orghttps://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
>