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

Aaron Parecki <aaron@parecki.com> Sun, 05 November 2023 19:19 UTC

Return-Path: <aaron@parecki.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 83792C1CAFED for <oauth@ietfa.amsl.com>; Sun, 5 Nov 2023 11:19:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.105
X-Spam-Level:
X-Spam-Status: No, score=-2.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, HTML_MESSAGE=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, 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=parecki.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 WGqkGbnxknol for <oauth@ietfa.amsl.com>; Sun, 5 Nov 2023 11:19:00 -0800 (PST)
Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (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 D72C5C18FCBE for <oauth@ietf.org>; Sun, 5 Nov 2023 11:19:00 -0800 (PST)
Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6ce353df504so2228124a34.3 for <oauth@ietf.org>; Sun, 05 Nov 2023 11:19:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=parecki.com; s=google; t=1699211939; x=1699816739; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SZ7SQ2TXNuQ4nKyaJEJFxpWQW0lhREKz75win/3sJIQ=; b=fw04AAUqCHkZezPkIFpnyqP4za4Rwobf4iNs6mNWqyvV8mBF5sXZsz3DpN6H86QYpP 4O0s8AqUiduZ+Ho0HOZlHqBx5p1VJvFiGhbYu7iHEqCpvn5G2Ois2Poz+Fu6Gr5FZU5+ xN1d3pLUHwBN9XVT1vx+9evIkhZNmqj7cNZ+DxGzySedCdgSNkdJZm7S6ZiAPH7sygyI 8uk2q6H8x5Hys2B9VN1S1md1Sv4Zknnel3lw8Pa7GE+pdr22LSv1UbW4HCpggFpzEiO7 t2fV59XNEgK2b4N4p3jDfu1tbf9ykGOAURWeZGCybWFqO7d1Zd5lSP/E95RZQTr0+GeQ kYQA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699211939; x=1699816739; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SZ7SQ2TXNuQ4nKyaJEJFxpWQW0lhREKz75win/3sJIQ=; b=N91aeBT1GlO1CcM112u50XV1ZG6bSsyfLXcfwxI1Iv+Kw5XfFMHUyYAss9HKKcDdH6 la8PgJx4/w7NraCiJHEKTSKaNbQpHUQHyMHHLhl/oGLWwxfcmmraQJpfwpBEEGR5HCd2 d5cG/4QMProxB8OvgLI/pI7UDZVfDjOLk8a0r98g/XEvEqtJpKzE7rJdRrT3JumG+Gt/ qRc9+BEahvPOynUflh2Wbs/qrtnTFoGVvkdvSEow43cMwnm3S0No4fLnFrWTBPvjFPjb 4pxCozgnNqwHrMfbd43bvrfhY7J56w5PpDy0v/1TC4EdktdwKYNBu5BQGsJ/V0euFWb7 8EcA==
X-Gm-Message-State: AOJu0Yw2GmHDQdP71IISvB4YpX1sA/GGe/GKoFH/AFIHmwZJVPdRpx3w b3l4BqPPAiAoSSKHWR7362ydOXAmqncoq0xC4u9/vdrG
X-Google-Smtp-Source: AGHT+IGEu/ChExwTUo63z6egeMkwuEv6eF2uTIIpD7UYP/itahm7dEU1Ng1De5hQCYYTPLRlc1hgew==
X-Received: by 2002:a05:6830:2644:b0:6d3:1369:aed with SMTP id f4-20020a056830264400b006d313690aedmr20414704otu.13.1699211939622; Sun, 05 Nov 2023 11:18:59 -0800 (PST)
Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com. [209.85.160.54]) by smtp.gmail.com with ESMTPSA id d19-20020a056830005300b006ce25d48e55sm1005928otp.67.2023.11.05.11.18.59 for <oauth@ietf.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Nov 2023 11:18:59 -0800 (PST)
Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-1ef36a04931so2291105fac.2 for <oauth@ietf.org>; Sun, 05 Nov 2023 11:18:59 -0800 (PST)
X-Received: by 2002:a05:6870:1118:b0:1ef:f14e:6f52 with SMTP id 24-20020a056870111800b001eff14e6f52mr16696567oaf.11.1699211939116; Sun, 05 Nov 2023 11:18:59 -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>
In-Reply-To: <f6383d62-9586-49c9-a824-9d92288ee4bd@danielfett.de>
From: Aaron Parecki <aaron@parecki.com>
Date: Sun, 05 Nov 2023 11:18:47 -0800
X-Gmail-Original-Message-ID: <CAGBSGjqe2HjJuh6OgJy5VU+w8HRyu159uJtMnmXS+LPWg_LphA@mail.gmail.com>
Message-ID: <CAGBSGjqe2HjJuh6OgJy5VU+w8HRyu159uJtMnmXS+LPWg_LphA@mail.gmail.com>
To: Daniel Fett <fett=40danielfett.de@dmarc.ietf.org>
Cc: oauth@ietf.org
Content-Type: multipart/alternative; boundary="000000000000077e4c06096c9c3d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/qFkgH5SpB4Zo71ODsKM9-Aiz2Os>
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:19:04 -0000

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
>