Re: [babel] Solving HMAC replay once and for all

Juliusz Chroboczek <jch@irif.fr> Fri, 29 June 2018 01:27 UTC

Return-Path: <jch@irif.fr>
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 2F85F130E3C for <babel@ietfa.amsl.com>; Thu, 28 Jun 2018 18:27:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham 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 yHN5dXUviXzo for <babel@ietfa.amsl.com>; Thu, 28 Jun 2018 18:27:15 -0700 (PDT)
Received: from korolev.univ-paris7.fr (korolev.univ-paris7.fr [IPv6:2001:660:3301:8000::1:2]) (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 CEA65130DD7 for <babel@ietf.org>; Thu, 28 Jun 2018 18:27:14 -0700 (PDT)
Received: from mailhub.math.univ-paris-diderot.fr (mailhub.math.univ-paris-diderot.fr [81.194.30.253]) by korolev.univ-paris7.fr (8.14.4/8.14.4/relay1/75695) with ESMTP id w5T1QVbd001827; Fri, 29 Jun 2018 03:26:31 +0200
Received: from mailhub.math.univ-paris-diderot.fr (localhost [127.0.0.1]) by mailhub.math.univ-paris-diderot.fr (Postfix) with ESMTP id 38CBAEB22D; Fri, 29 Jun 2018 03:27:13 +0200 (CEST)
X-Virus-Scanned: amavisd-new at math.univ-paris-diderot.fr
Received: from mailhub.math.univ-paris-diderot.fr ([127.0.0.1]) by mailhub.math.univ-paris-diderot.fr (mailhub.math.univ-paris-diderot.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id kuRrQ5WlSpep; Fri, 29 Jun 2018 03:27:12 +0200 (CEST)
Received: from pirx.irif.fr (unknown [78.194.40.74]) (Authenticated sender: jch) by mailhub.math.univ-paris-diderot.fr (Postfix) with ESMTPSA id 13634EB200; Fri, 29 Jun 2018 03:27:12 +0200 (CEST)
Date: Fri, 29 Jun 2018 03:27:06 +0200
Message-ID: <87zhze5qmt.wl-jch@irif.fr>
From: Juliusz Chroboczek <jch@irif.fr>
To: Markus Stenberg <markus.stenberg@iki.fi>
Cc: babel@ietf.org
In-Reply-To: <C59C3F6D-5B0E-4013-867D-EEBF6D56FD77@iki.fi>
References: <87muvgh08w.wl-jch@irif.fr> <B79AE9F0-772A-4068-86CF-942ED6B8C5DF@iki.fi> <87k1qkgys1.wl-jch@irif.fr> <572D5E74-BE2D-4CD7-BCF4-4BD008D597AD@iki.fi> <87fu18gw9r.wl-jch@irif.fr> <3EEA555D-F75C-4FD4-BFD5-4344E5EEAEEA@apple.com> <87po0b52vx.wl-jch@irif.fr> <AD5721CC-523E-4582-A612-13464B0F27F6@apple.com> <87in63an71.wl-jch@irif.fr> <87fu17an1y.wl-jch@irif.fr> <6CE390DB-EE38-4D62-B56A-A451A02FE723@apple.com> <6DBB10F7-6F1B-4909-894D-16FCD2C7DEF0@iki.fi> <3D958DDA-4382-45AB-B87D-3B93EF330D05@iki.fi> <87lgaznt2h.wl-jch@irif.fr> <CF2F907B-6B9E-4410-ADCB-0A194FF4B8E2@iki.fi> <87h8lnnrkr.wl-jch@irif.fr> <521CBB64-7A4C-497B-AF71-1E23344FC7E6@iki.fi> <87efgrnovg.wl-jch@irif.fr> <87woujjgxc.fsf@toke.dk> <C59C3F6D-5B0E-4013-867D-EEBF6D56FD77@iki.fi>
User-Agent: Wanderlust/2.15.9
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset="US-ASCII"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (korolev.univ-paris7.fr [194.254.61.138]); Fri, 29 Jun 2018 03:26:31 +0200 (CEST)
X-Miltered: at korolev with ID 5B358AC7.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)!
X-j-chkmail-Enveloppe: 5B358AC7.000 from mailhub.math.univ-paris-diderot.fr/mailhub.math.univ-paris-diderot.fr/null/mailhub.math.univ-paris-diderot.fr/<jch@irif.fr>
X-j-chkmail-Score: MSGID : 5B358AC7.000 on korolev.univ-paris7.fr : j-chkmail score : . : R=. U=. O=. B=0.000 -> S=0.000
X-j-chkmail-Status: Ham
Archived-At: <https://mailarchive.ietf.org/arch/msg/babel/uYqQzayGExB4mJs8eswYEyzq0eQ>
Subject: Re: [babel] Solving HMAC replay once and for all
X-BeenThere: babel@ietf.org
X-Mailman-Version: 2.1.26
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: Fri, 29 Jun 2018 01:27:17 -0000

> The normal packet reception flow just:
> -  computes pseudoheader, hashes that + what was received, and compares it with the trailer HMAC. 
> - If success, compare counter, 
>   - if too old (modulo replay window if any), drop, otherwise process normally.
> - If failure, maybe challenge (see above).

Hmm... so now both challenges and challenge replies are unprotected by
HMAC (since they need to be acted upon even in case of HMAC failure),
right?  Therefore, we put them in the packet trailer, so that we can
retain the property that we don't parse the packet body before HMAC
validation.

Implementation complexity is comparable, I think.  However, now the
Neighbour Table entry is created before HMAC validation (to keep the
challenge state), so an evil peer is able to create unbounded amounts of
state (by spoofing multiple source addresses).  I guess you could avoid
that by encoding a cookie in your nonce, but that in turn increases
implementation complexity.

Am I missing something?

-- Juliusz "I'll sleep when I retire" Chroboczek