Re: Comments on draft-ietf-bfd-secure-sequence-numbers-12.txt

Jeffrey Haas <jhaas@pfrc.org> Tue, 16 January 2024 16:28 UTC

Return-Path: <jhaas@pfrc.org>
X-Original-To: rtg-bfd@ietfa.amsl.com
Delivered-To: rtg-bfd@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7550DC14F705; Tue, 16 Jan 2024 08:28:40 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.91
X-Spam-Level:
X-Spam-Status: No, score=-1.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
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 RtOtXMvz-_vQ; Tue, 16 Jan 2024 08:28:36 -0800 (PST)
Received: from slice.pfrc.org (slice.pfrc.org [67.207.130.108]) by ietfa.amsl.com (Postfix) with ESMTP id 83264C14F6E1; Tue, 16 Jan 2024 08:28:35 -0800 (PST)
Received: from smtpclient.apple (172-125-100-52.lightspeed.livnmi.sbcglobal.net [172.125.100.52]) by slice.pfrc.org (Postfix) with ESMTPSA id B16091E039; Tue, 16 Jan 2024 11:28:34 -0500 (EST)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.4\))
Subject: Re: Comments on draft-ietf-bfd-secure-sequence-numbers-12.txt
From: Jeffrey Haas <jhaas@pfrc.org>
In-Reply-To: <E718BC59-7496-4E73-A4D9-AA5015DD9449@deployingradius.com>
Date: Tue, 16 Jan 2024 11:28:34 -0500
Cc: rtg-bfd@ietf.org, draft-ietf-bfd-secure-sequence-numbers@ietf.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <EF836FF4-708A-4985-8FD1-56CD4EC4943E@pfrc.org>
References: <170130738712.52125.9313047708000913054@ietfa.amsl.com> <20240115232214.GB20424@pfrc.org> <E718BC59-7496-4E73-A4D9-AA5015DD9449@deployingradius.com>
To: Alan DeKok <aland@deployingradius.com>
X-Mailer: Apple Mail (2.3696.120.41.1.4)
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtg-bfd/yR6cCfFHYaQ4qd0USC826hUIjpo>
X-BeenThere: rtg-bfd@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "RTG Area: Bidirectional Forwarding Detection DT" <rtg-bfd.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtg-bfd>, <mailto:rtg-bfd-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rtg-bfd/>
List-Post: <mailto:rtg-bfd@ietf.org>
List-Help: <mailto:rtg-bfd-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtg-bfd>, <mailto:rtg-bfd-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 16 Jan 2024 16:28:40 -0000

Alan,


> On Jan 15, 2024, at 7:25 PM, Alan DeKok <aland@deployingradius.com> wrote:
> On Jan 15, 2024, at 6:22 PM, Jeffrey Haas <jhaas@pfrc.org> wrote:
>> 1. We learn the Seed for this session for the first time.  This somewhat
>> argues we need a bfd.MetKeyIsaacKnown variable.  We require it to not
>> change.  Note that it's critical that we say that we're setting it only
>> after ISAAC authentication has succeeded.
> 
>  That makes sense.
> 
>> 2. We need to generate the ISAAC table from the existing sequence number.
>> It can't simply be sequence 0 because that's attackable.
> 
>  Section 5.1 defines how ISAAC is seeded.  It doesn't use sequence numbers to generate the information.
> 
>  More below.
> 
>> 3. Since we can't set it to zero, and we don't want to generate all
>> intervening ISAAC pages to "catch up" to our random sequence number we
>> started with,
> 
>  But we don't need to "catch up".   We just need to record that we started at an agreed-upon sequence number.

We appear to be in agreement about that, but that's not what the current text seems to say.  In particular, the reset to seq#.

> The important bit is that we have a transition from
> 
> 	 bfd.MetKeyIsaacKnown=false
> 
>  to
> 
> 	 bfd.MetKeyIsaacKnown=true
> 
>  When that transition happens, the sequence number in the packet is used as the start point.  That number is the new bfd.MetKeyIsaacPageBase variable you mentioned.
> 
>  Saving that number means that if we get a new sequence number Y, we can do:
> 
> 	Auth Key index = Y - bfd.MetKeyIsaacPageBase
> 
>  If that value is smaller than 256, the sequence number is in the current page.  If it's 256 or more, then we need to generate a new page.

We're in agreement.

There is one additional corner case to deal with.  Here's the scenario:

A is transitioning from strong authentication to ISAAC.  
A's seq# mod 256 is 255.  
A's seq# div 0 is "0" - the first page.  This is recorded as the local page base for A.
The BFD PDU containing this is sent to B.

The packet to B is lost!

A's next seq# puts it into page 1, index 0.
The BFD PDU containing this is sent to B.

B receives this PDU.  
It notes the seed value, auth ID, and sequence number.
Having received this seed the first time, it treats this seq# as page 0.
Seeking into its first page, index 0, the ISAAC authentication fails.

The issue above illustrates the problem we have with no negotiation between the systems about where page 0 exists.  If BFD were reliable, this wouldn't be a problem.  We have two likely solutions:

Option 1:
"Page 0" is placed into the ISAAC authentication section in BFD.  Doable, crystal clear, and at best noise.  At worst, it provides one additional hint for someone who is brute forcing the passwords.

Option 2:
Each side changing to ISAAC authentication knows that lost packets could be a problem.  The draft says the window we need to keep around is 3*Detect Mult as part of our receive procedures.  Ergo, as long as the side transitioning into ISAAC does so only at a sequence number such that it is within the 3*Detect Mult window, it's reasonable to expect that at least ONE of the packets is expected to get through to the remote side.

Side observation1: I no longer remember why RFC 5880 chose the 3* multiplier.

Side observation 2: The Detect Mult itself can go up to 255.  This pathologically means the session may stay up under hefty packet loss and the best we can do is do the switch starting at index 0 of a new page and hope that we sync up.

-----

Another point likely in need of text in the draft is what ISAAC needs to have done when switching from ISAAC back to strong authentication.  Since the sequence numbers are kept going regardless of the authentication mechanism, ISAAC will need to produce new pages when it flips to strong authentication.  This is to avoid needing to "fast forward" if strong authentication is left going for a while.

-- Jeff