Re: [OAUTH-WG] Adam Roach's No Objection on draft-ietf-oauth-native-apps-11: (with COMMENT)

Adam Roach <adam@nostrum.com> Tue, 23 May 2017 16:53 UTC

Return-Path: <adam@nostrum.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 0113D1201F8; Tue, 23 May 2017 09:53:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.88
X-Spam-Level:
X-Spam-Status: No, score=-1.88 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.001, T_SPF_HELO_PERMERROR=0.01, T_SPF_PERMERROR=0.01] autolearn=unavailable autolearn_force=no
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 SVdmUqpbfCTL; Tue, 23 May 2017 09:53:26 -0700 (PDT)
Received: from nostrum.com (raven-v6.nostrum.com [IPv6:2001:470:d:1130::1]) (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 DF71C1200C5; Tue, 23 May 2017 09:53:25 -0700 (PDT)
Received: from Orochi.local (99-152-146-228.lightspeed.dllstx.sbcglobal.net [99.152.146.228]) (authenticated bits=0) by nostrum.com (8.15.2/8.15.2) with ESMTPSA id v4NGrDpH016662 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 23 May 2017 11:53:14 -0500 (CDT) (envelope-from adam@nostrum.com)
X-Authentication-Warning: raven.nostrum.com: Host 99-152-146-228.lightspeed.dllstx.sbcglobal.net [99.152.146.228] claimed to be Orochi.local
To: Alexey Melnikov <aamelnikov@fastmail.fm>, William Denniss <wdenniss@google.com>
Cc: draft-ietf-oauth-native-apps@ietf.org, Hannes Tschofenig <Hannes.Tschofenig@gmx.net>, oauth@ietf.org, The IESG <iesg@ietf.org>, oauth-chairs@ietf.org
References: <149548482877.9096.13896958451655712801.idtracker@ietfa.amsl.com> <CAAP42hAcc5qGCxMC-Qj=G5BKQ9kRv9N6_pdtjH8mxUCcFCD_8g@mail.gmail.com> <1D2FDD6E-3DA0-4E7C-BBF3-1A6146F7889B@fastmail.fm> <1495534158.1405045.985657536.26AE401D@webmail.messagingengine.com>
From: Adam Roach <adam@nostrum.com>
Message-ID: <eed235aa-745b-a918-cbb2-348f3dab6c12@nostrum.com>
Date: Tue, 23 May 2017 11:53:08 -0500
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:52.0) Gecko/20100101 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <1495534158.1405045.985657536.26AE401D@webmail.messagingengine.com>
Content-Type: multipart/alternative; boundary="------------0D53017DEE4387F52677BBB4"
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/tap16TXWC1jZzKvTxfv2A2VYYaw>
Subject: Re: [OAUTH-WG] Adam Roach's No Objection on draft-ietf-oauth-native-apps-11: (with COMMENT)
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.22
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: Tue, 23 May 2017 16:53:27 -0000

On 5/23/17 05:09, Alexey Melnikov wrote:
> On Tue, May 23, 2017, at 10:24 AM, Alexey Melnikov wrote:
>> Hi William,
>>
>> On 22 May 2017, at 23:14, William Denniss <wdenniss@google.com 
>> <mailto:wdenniss@google.com>> wrote:
>>>
>>>     Section 8.1 makes the statement that "Loopback IP based redirect
>>>     URIs may
>>>     be susceptible to interception by other apps listening on the same
>>>     loopback interface." That's not how TCP listener sockets work:
>>>     for any
>>>     given IP address, they guarantee single-process access to a port
>>>     at any
>>>     one time. (Exceptions would include processes with root access,
>>>     but an
>>>     attacking process with that level of access is going to be
>>>     impossible to
>>>     defend against). While mostly harmless, the statement appears to
>>>     be false
>>>     on its face, and should be removed or clarified.
>>>
>>>
>>> Will be removed in the next update. Thank you.
>>
>> Actually, I disagree with Adam on this, because what he says is OS 
>> specific. So I think the text is valuable and should stay.
>>
> In particular, I think SO_REUSEADDR socket option is widely 
> implemented, both on Windows and Linux.
>

Okay, after doing a lot of digging, this appears to be much more 
complicated than it should be [1]. Linux (as of 3.9) does allow multiple 
_listeners_ on a single IP/Address pair (and does load balancing among 
them o_O), but only if they're both using SO_REUSEADDR ("don't do that 
then" would be good advice). Windows allows the kind of hijacking 
described in the document unless SO_EXCLUSIVEADDRUSE is set (and it 
might be good advice in this document to suggest setting it).

So I'm okay with the paragraph staying in, although I would like to see 
it qualified with "on some operating systems", and would like to see a 
note (probably in section B.3) recommending the use of 
SO_EXCLUSIVEADDRUSE on listening sockets.

/a


____

[1] The most comprehensive explanation of facts on the ground that I 
could find is 
https://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t