Re: [babel] Roman Danyliw's Discuss on draft-ietf-babel-hmac-08: (with DISCUSS and COMMENT)

Roman Danyliw <rdd@cert.org> Thu, 17 October 2019 19:11 UTC

Return-Path: <rdd@cert.org>
X-Original-To: babel@ietfa.amsl.com
Delivered-To: babel@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7804912090E; Thu, 17 Oct 2019 12:11:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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 (1024-bit key) header.d=cert.org
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 SBvTTqADqGMO; Thu, 17 Oct 2019 12:11:39 -0700 (PDT)
Received: from veto.sei.cmu.edu (veto.sei.cmu.edu [147.72.252.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EF8871209B5; Thu, 17 Oct 2019 12:11:38 -0700 (PDT)
Received: from korb.sei.cmu.edu (korb.sei.cmu.edu [10.64.21.30]) by veto.sei.cmu.edu (8.14.7/8.14.7) with ESMTP id x9HJBUfc011239; Thu, 17 Oct 2019 15:11:30 -0400
DKIM-Filter: OpenDKIM Filter v2.11.0 veto.sei.cmu.edu x9HJBUfc011239
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cert.org; s=yc2bmwvrj62m; t=1571339490; bh=vxcrsJgkO6oohORnc/quJuvovVihcSvS5On1Rt78wI4=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=EZT862gEipfvUVlQUi2auRE49boLd5ch7sZMta0pFZXRxMjnTbAptQQ9dvBN4fYBi EZwJ8wy+z9D2KQkrbvmJnMIQ0lk+1BlAhj5QxQophhI8O0EkO4JoIcsZHJZ5RzuSW1 X0v0kjEe8riWLCqp7i1TYhckmvcnwlq8tK6NWFqU=
Received: from CASCADE.ad.sei.cmu.edu (cascade.ad.sei.cmu.edu [10.64.28.248]) by korb.sei.cmu.edu (8.14.7/8.14.7) with ESMTP id x9HJBZrM022513; Thu, 17 Oct 2019 15:11:36 -0400
Received: from MARATHON.ad.sei.cmu.edu ([10.64.28.250]) by CASCADE.ad.sei.cmu.edu ([10.64.28.248]) with mapi id 14.03.0468.000; Thu, 17 Oct 2019 15:11:35 -0400
From: Roman Danyliw <rdd@cert.org>
To: Juliusz Chroboczek <jch@irif.fr>
CC: Donald Eastlake <d3e3e3@gmail.com>, "babel-chairs@ietf.org" <babel-chairs@ietf.org>, The IESG <iesg@ietf.org>, "babel@ietf.org" <babel@ietf.org>, "draft-ietf-babel-hmac@ietf.org" <draft-ietf-babel-hmac@ietf.org>
Thread-Topic: Roman Danyliw's Discuss on draft-ietf-babel-hmac-08: (with DISCUSS and COMMENT)
Thread-Index: AQHVTVc7EhiAo9Vjs0mVXthEfhPXuKbxh9sAgAAnvwCADQOVgIBg7sbw
Date: Thu, 17 Oct 2019 19:11:34 +0000
Message-ID: <359EC4B99E040048A7131E0F4E113AFC01B348C8C1@marathon>
References: <156520650683.8432.7109781814790904901.idtracker@ietfa.amsl.com> <87v9v7wyzz.wl-jch@irif.fr> <359EC4B99E040048A7131E0F4E113AFC01B3402CA5@marchand> <87blwoiuxo.wl-jch@irif.fr>
In-Reply-To: <87blwoiuxo.wl-jch@irif.fr>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.64.22.6]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/babel/Bi9ogatHpiPeev6KMMdBj2N_Arg>
Subject: Re: [babel] Roman Danyliw's Discuss on draft-ietf-babel-hmac-08: (with DISCUSS and COMMENT)
X-BeenThere: babel@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "A list for discussion of the Babel Routing Protocol." <babel.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/babel>, <mailto:babel-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/babel/>
List-Post: <mailto:babel@ietf.org>
List-Help: <mailto:babel-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/babel>, <mailto:babel-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 17 Oct 2019 19:11:42 -0000

Hello Juliusz!

My apologizes for the long delay.  Thank you for addressing my DISCUSS points with the updated -08 and the discussion.  I've cleared my ballot.

Roman

> -----Original Message-----
> From: Juliusz Chroboczek [mailto:jch@irif.fr]
> Sent: Friday, August 16, 2019 6:53 PM
> To: Roman Danyliw <rdd@cert.org>
> Cc: Donald Eastlake <d3e3e3@gmail.com>; babel-chairs@ietf.org; The IESG
> <iesg@ietf.org>; babel@ietf.org; draft-ietf-babel-hmac@ietf.org
> Subject: Re: Roman Danyliw's Discuss on draft-ietf-babel-hmac-08: (with
> DISCUSS and COMMENT)
> 
> > Ah, I see it now in Section 4.3 Thanks for the pointer.  This text
> > explains the issues of around keys processing.  I couldn't explicitly
> > find text explaining when multiple HMAC TLVs should be sent.  Where
> > should I be looking?
> 
> Section 5 (key rotation), formerly Appendix A:
> 
>    In order to perform key rotation, the new key is added to all the
>    nodes; once this is done, both the old and the new key are sent in
>    all packets, and packets are accepted if they are properly signed by
>    either of the keys.  At that point, the old key is removed.
> 
> >> I'm leaving this sentence as is -- after trying it out, I don't think
> >> that mentioning the small amount of state caused by reception of a
> >> UDP packet (an ND entry) is informative.
> 
> > I'm not tracking.  "Whatsoever" is an absolute statement.  By all
> > means caveat the sentence by saying no local Babel state (or something
> > to that effect).
> 
> Done.
> 
> >>> (8) Section 1.  Per the “spoof of a malformed packet”, how would an
> >>> HMAC address this?  Even assuming that a node discards the message
> >>> without processing if the HMAC is bad, this would still be a problem
> >>> from a malicious peer.
> 
> >> Please explain.
> 
> > The initial situation I had in mind was if there was a compromised
> > Babel node.  It will have the key to produce a valid HMAC on the
> > crafted packet to cause the peer Babel node to process the packet.
> 
> Yes, this protocol assumes that only honest nodes know the secret key.  We
> make no guarantees, not even of any kind, if you've lost your keys.
> 
> > Another situation which would not involve a malicious Babel node with
> > the key is a node running a buggy Babel implementation.  Imagine this
> > implementation has some kind of (buffer overflow) vulnerability in the
> > routines which parses the packet payload to find the HMAC TLV.  In the
> > worst circumstance, this could hypothetically compromise the Babel
> > node even before the code to verified HMAC and choose to discard the
> > packet or not is made.
> 
> Yes, it could.
> 
> That is the reason why HMAC keys sit in the packet trailer rather than in the
> packet body: you may use a simplified parser that is only able to parse the
> packet trailer.  This parser does not modify any global state, it does not
> modify the packet (there's no need to clear the MAC before recomputing it),
> and it just returns one bit of information.  You are expected to vet this
> specialised parser very carefully, or even run it out-of-process.
> 
> This was debated by the WG; however, once both Toke (BIRD) and Weronika
> and Clara (babeld) had implemented parsing the packet trailer, we agreed
> that this approach makes the implementation much simpler and less error-
> prone.
> 
> -- Juliusz