Re: [OAUTH-WG] Web apps BCP feedback

Jim Manico <jim@manicode.com> Sat, 25 September 2021 22:15 UTC

Return-Path: <jim@manicode.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 0D1133A07B8 for <oauth@ietfa.amsl.com>; Sat, 25 Sep 2021 15:15:47 -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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, 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=manicode.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 kyhkLQ07p3pP for <oauth@ietfa.amsl.com>; Sat, 25 Sep 2021 15:15:41 -0700 (PDT)
Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) (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 E1C743A07B6 for <oauth@ietf.org>; Sat, 25 Sep 2021 15:15:41 -0700 (PDT)
Received: by mail-pf1-x42f.google.com with SMTP id g2so8000147pfc.6 for <oauth@ietf.org>; Sat, 25 Sep 2021 15:15:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manicode.com; s=google; h=message-id:date:mime-version:user-agent:content-language:to:cc :references:from:subject:in-reply-to; bh=R82QBlQrFPFuDY8W/p86N8AaRb9W96SEwR5K0KhnnIo=; b=Eho6D0BrdPNEShuP7vqWwnM8MK0IJry/0oYK+4V8vs9xZau+F/4JTGkOgoOwZAVO+3 erA93DI9ZrEAaYRkhsjKRIVpWyfSHOtmpbtG/npPFnw0loN/jhIcjWomU/bLSloC89d3 Xw4ZYt0R65WRCwcbLfyr4ga8ZXRsiHPfCHZWCFfGfqKxwIkaw8kmoh+8FtJ28JahKO7z qPawHQkuwAx5P8Bz7KbTBBWhCzinRNeEGNRSUSLDFYHD5pifl3VDnAZ4A7zr7VuHTiip 9ROKERFeolbv+N7BxRx4hFFExGJbS7recnDh4fswz+YEZHfKqdDqFkptMQp+HUAxBmbL GYnw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to; bh=R82QBlQrFPFuDY8W/p86N8AaRb9W96SEwR5K0KhnnIo=; b=zOXqm2wnpsJ6CetW1lmfKcmhx+z9u5V2RRh5chNRdMCJq010g8mTFGNEezXqE6bZCN QDLMFrcZ6Ykq+oFj1haraPZTgTJRSW7gofTbMzWTrAIbSXTdG5V/SdxyXilcv1CWOxNB EZLAJX0kNie5dgdPZLyLza1zQcrOidC9u53ceSD8BwNuu9q27BLBaBlTLBfpHiGd0rCp sl62ti1YOExV+r9+8Gfxn59JswhBWxK4Mygv5sw7s/5Ae+Fxc9+L//WRSyAcCCCseaJk vsmnZmfSu8Jtli+gbr0k3TT02CPwSsZnJ3ePGnge80qWS87vWNGMZEQlcqTLGDQcdkF3 6ZtA==
X-Gm-Message-State: AOAM533db1ICnY6NstA9MaymMOW70G2iA7iUc9pDlSqzmleqKd4eOhN1 qQOnlUrO9V4MvH/P46nsGJaeQQ==
X-Google-Smtp-Source: ABdhPJzcFXd8YV7zdqUbXhOga8gUdqMEjP+DHEL5z8yRHPScos/ugFJNoxztegqrIu5opsfDQCthWg==
X-Received: by 2002:a65:44c4:: with SMTP id g4mr9944030pgs.254.1632608140524; Sat, 25 Sep 2021 15:15:40 -0700 (PDT)
Received: from [192.168.86.41] (204-210-127-015.res.spectrum.com. [204.210.127.15]) by smtp.googlemail.com with ESMTPSA id x15sm13915581pgt.34.2021.09.25.15.15.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Sep 2021 15:15:40 -0700 (PDT)
Content-Type: multipart/alternative; boundary="------------ANiAJ0VplaxbFIWG5BQiDZc5"
Message-ID: <8645e6a3-6c23-05f0-2165-579d502109b7@manicode.com>
Date: Sat, 25 Sep 2021 12:15:38 -1000
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.1.1
Content-Language: en-US
To: Neil Madden <neil.madden@forgerock.com>
Cc: Dominick Baier <dbaier@leastprivilege.com>, oauth <oauth@ietf.org>
References: <2EA892D6-D2F5-46AA-9B03-63F7AC4C5A69@manicode.com> <7306C2C0-DC84-4A0B-9344-EF238F6A7E44@forgerock.com>
From: Jim Manico <jim@manicode.com>
In-Reply-To: <7306C2C0-DC84-4A0B-9344-EF238F6A7E44@forgerock.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/t_X94UhmV-jnoYV70bOn6bEv57Q>
Subject: Re: [OAUTH-WG] Web apps BCP feedback
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: Sat, 25 Sep 2021 22:15:47 -0000

Hi Neil! =)

I get your point!

I would suggest this text be written as something along the lines of:

"Additionally, the SameSite cookie attribute can be used to
   prevent CSRF attacks /*but the application and API should*//*also*/
/**//**//*  be written to use */anti-CSRF tokens for stateful 
session-based applications
           or use of the double-cookie submit pattern for stateless 
applications.”'

PS: If an adversary controls a subdomain can't they clobber and 
over-write root level cookies anyhow? I do not think CSRF defense will 
defeat an adversarial subdomains ability to over-write a cookie and 
circumvent double-cookie-submit.

On 9/25/21 8:10 AM, Neil Madden wrote:
> Technically yes, CSRF refers to cross-site attacks. However, there is 
> a class of attacks that are cross-*origin* but not cross-site and 
> which are otherwise identical to CSRF. SameSite doesn’t protect 
> against these attacks but other traditional CSRF defences *do*. For 
> example, synchronizer tokens in hidden form fields or even just 
> requiring a custom header on requests both provide some protection 
> against such attacks, as they both use mechanisms that are subject to 
> the same origin policy rather than same-site.
>
> — Neil
>
>> On 25 Sep 2021, at 18:20, Jim Manico <jim@manicode.com> wrote:
>>
>>  If someone has taken over a subdomain in the ways described, that 
>> is not cross site request forgery since the attack is occurring from 
>> within your site. It’s more likely XSS that allows for cookie 
>> clobbering or similar, or just malicious code injected by the 
>> malicious controller of your subdomain. This is not strictly CSRF nor 
>> are these problems protected from any other standard form of CSRF 
>> defense.
>>
>> CSRF is Cross Site attack where the attack is hosted on a different 
>> domain.
>>
>> --
>> Jim Manico
>>
>>> On Sep 25, 2021, at 1:07 AM, Dominick Baier 
>>> <dbaier@leastprivilege.com> wrote:
>>>
>>> 
>>> In 6.1 it says
>>>
>>> "Additionally, the SameSite cookie attribute can be used to
>>>   prevent CSRF attacks, or alternatively, the application and API could
>>>   be written to use anti-CSRF tokens.”
>>>
>>> “Prevent” is a bit strong.
>>>
>>> SameSite only restricts cookies sent across site boundaries Iit does 
>>> not prevent CSRF attacks from within a site boundary. Scenarios 
>>> could be a compromised sub-domain, like sub-domain takeover or just 
>>> some vulnerable application co-located on the same site.
>>>
>>> thanks
>>> ———
>>> Dominick Baier
>>> _______________________________________________
>>> 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
>
> Manage My Preferences <https://preferences.forgerock.com/>, 
> Unsubscribe <https://preferences.forgerock.com/>
>
-- 
Jim Manico
Manicode Security
https://www.manicode.com