Re: [DNSOP] Comments regarding the NSEC5

Jan Včelák <jan.vcelak@nic.cz> Wed, 11 March 2015 16:19 UTC

Return-Path: <jan.vcelak@nic.cz>
X-Original-To: dnsop@ietfa.amsl.com
Delivered-To: dnsop@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C1AB91A92EF for <dnsop@ietfa.amsl.com>; Wed, 11 Mar 2015 09:19:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.361
X-Spam-Level:
X-Spam-Status: No, score=-0.361 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HELO_EQ_CZ=0.445, HOST_EQ_CZ=0.904, MIME_8BIT_HEADER=0.3, T_RP_MATCHES_RCVD=-0.01] autolearn=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 Dfbocb6wII7h for <dnsop@ietfa.amsl.com>; Wed, 11 Mar 2015 09:19:13 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E63A41ACD68 for <dnsop@ietf.org>; Wed, 11 Mar 2015 09:19:05 -0700 (PDT)
Received: from [192.168.0.111] (ip-89-177-126-217.net.upcbroadband.cz [89.177.126.217]) by mail.nic.cz (Postfix) with ESMTPSA id 5BFF613F74F; Wed, 11 Mar 2015 17:19:04 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=nic.cz; s=default; t=1426090744; bh=zitJHC3+2C0v6keQC7o32mv7IBffIkV40iFaQPbkTjQ=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=BakaA3N4KtsLxr9ASt+SmUXAgX1I1+uHeTWjaCOJ+YBNi1ZcmCKC1U1S11yqonAgO LAC3ankjkWGhOyZd0qBgpX373Pz76iiONsmvXC355E44dzUfAAzWCxjhWWMCpm8j6x ceAb7SYK9IMYjggcNSVMzA06zdTl96VnMw0/XXoI=
Message-ID: <55006AF8.4090500@nic.cz>
Date: Wed, 11 Mar 2015 17:19:04 +0100
From: Jan Včelák <jan.vcelak@nic.cz>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0
MIME-Version: 1.0
To: Florian Weimer <fweimer@redhat.com>
References: <55002098.5060709@redhat.com>
In-Reply-To: <55002098.5060709@redhat.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 0.98.6 at mail
X-Virus-Status: Clean
Archived-At: <http://mailarchive.ietf.org/arch/msg/dnsop/95OnsjNHmxVOjPmgZ-2hxR-Eo34>
X-Mailman-Approved-At: Wed, 11 Mar 2015 09:43:19 -0700
Cc: dnsop@ietf.org
Subject: Re: [DNSOP] Comments regarding the NSEC5
X-BeenThere: dnsop@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: IETF DNSOP WG mailing list <dnsop.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dnsop>, <mailto:dnsop-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/dnsop/>
List-Post: <mailto:dnsop@ietf.org>
List-Help: <mailto:dnsop-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dnsop>, <mailto:dnsop-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Mar 2015 16:19:15 -0000

Hello Florian,

On 11.3.2015 12:01, Florian Weimer wrote:
> do you plan to submit this to an IETF working group, or as an individual
> submission?

We plan to submit the draft as an individual submission.

> It's not clear if the security goals make sense.  What do zone operators
> gain if zone enumeration attacks are moved from offline to online, other
> than a need to provision additional server capacity?  It's not that they
> can block resolution requests from large resolvers if a part of their
> client population participates in aggressive enumeration.

It dependes whether you see zone enumeration as a problem. NSEC5 is
designed as an alternative to NSEC/NSEC3, not a replacement.

If you consider the data in your zone public, use NSEC. If you need
Opt-Out, use NSEC3. If you don't want attackers to enumerate your zone,
use NSEC5 (or disable DNSSEC [sic]). And you are right, NSEC5 creates
additional performance capacity requirement. Everything comes at a price.

> Section 4 says, “NSEC5 hash is an SHA-256 hash function as specified in
> [RFC6234].”  Are you sure that's right?

You mean the reference to the RFC? Yes, I think it's right. Or am I
missing something?

> In any case, most references to “NSEC5 hash” are underspecified.  For
> example, in section 9.1, “The owner name of the NSEC5 RR is the NSEC5
> hash of the original owner name encoded in Base32hex without padding,
> prepended as a single label to the zone name”, could be read in various
> different ways.  It seems that Base32hex(SHA-256(Wire-Encode(owner
> name))) is meant, but it could also be read as SHA-256(Base32hex(owner
> name)) or something like that.

OK. You are right. It is underspecified.

In addition, there is an error in the quoted text. Therefore both of
your interpretations are incorrect. I will fix that.

We deal with NSEC5 proofs and NSEC5 hashes (see the Terminology
section). The NSEC5 proof is the FDH (can be comptuted only by the
holder of the NSEC5 private key); the NSEC5 hash is an SHA-256 hash of
the NSEC5 proof (everyone can compute it, if they know the NSEC5 proof).

So in your notation, an NSEC5 RR owner name should be:
Base32hex(SHA-256(FDH(Wire-Encode(owner name), privkey)))

> There does not seem to be anything in the draft that describes how the
> RDATA of the NSEC5PROOF is computed.  I think the intent is that it
> contains SHA-256(Wire-Encode(NSEC5 owner name)), and the validation is
> performed using a separate RRSIG record, signed with the NSEC5KEY public
> key.  However, section 9.2 does not mention that the NSEC5PROOF record
> is accompanied by an RRSIG RRset.

A few sentences are in 7.1. (NSEC5PROOF RDATA Wire Format): "Owner Name
Hash is a variable sized sequence of binary octets encoding the NSEC5
proof corresponding to the owner name."

It's the NSEC5 proof. Again, in your notation:
FDH(Wire-Encode(owner name), privkey))

I agree that the description is insufficient. We will fix that.

> The rollover mechanism in section 9.3 does not work reliably.  The old
> public key must be kept around until the TTL on the old NSEC5 and
> NSEC5PROOF RRs have expired (after the authoritative servers stopped
> serving them).  The old public key cannot be removed immediately.  It
> must be possible to re-fetch it in case a caching resolver expired it
> for some reason.

You are right. This is wrong. I will fix that.

> In Section 11.1, “at least one of the keys MUST validate”: This MUST is
> misleading because the section is about validator behavior, it needs to
> be lower case because this section cannot establish constraints on
> validator input.  There needs to be some discussion regarding the TTL on
> the NSEC5PROOF record, the validator should not accept arbitrary values
> there.

Good point.

> These days, online signatures should really use a non-deterministic
> signature scheme.  The deterministic FDH algorithm is very difficult to
> implement correctly.  But it is not actually referenced in the draft,
> there are no protocol elements that use FDH values.

NSEC5 relies on deterministic signature scheme for NSEC5 proofs. We
can't really use non-deterministic scheme, because we need exactly one
valid signature for a domain name and a key.

If the signature scheme allowed to issue two different valid signatures
for one input, the slave servers could cheat on the client. Because that
would render different NSEC5 hashes and thus different positions in the
NSEC5 chain.

Why is the FDH difficult to implement? Take a look at Appendix A. in our
draft.

I also wrote a reference implementation for FDH in OpenSSL and
GnuTLS/Nettle. You can take a look at it and review the code (nobody did
it yet): https://gitlab.labs.nic.cz/knot/nsec5-crypto

> As specified in the draft, the NSEC5 protocol still exposes the chain of
> SHA-256 hashes of owner names.  It does not offer better protection
> against offline dictionary attacks than NSEC3.

Not really. The chain is build from NSEC5 hashes. And the client cannot
compute the NSEC5 hash without having the NSEC5 proof. And the NSEC5
proof cannot be computed without the private key.

Thank you a lot for your remarks! I will process them soon.

Best regards,

Jan