[secdir] Re: [Last-Call] Re: Re: Secdir review of draft-eastlake-fnv

Brian E Carpenter <brian.e.carpenter@gmail.com> Mon, 14 October 2024 20:04 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: secdir@ietfa.amsl.com
Delivered-To: secdir@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D639BC1DFD50; Mon, 14 Oct 2024 13:04:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 XXeRrqYJVYDa; Mon, 14 Oct 2024 13:04:25 -0700 (PDT)
Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id ADCF6C1DFD59; Mon, 14 Oct 2024 13:04:20 -0700 (PDT)
Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-20ceb8bd22fso10526515ad.3; Mon, 14 Oct 2024 13:04:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728936260; x=1729541060; darn=ietf.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=UpLMikWzCXw4PnwYiCXRmC/z1d4sOwk4bKPiCw/jpho=; b=G8U48r0oeZhGBMOl/Josg/B53q2Tbi5MK88ekfhqd5fGvItf/SNghDhfrQdypYycYa vS51sit3cIZh0X4NoQoiGKtjOkg8MLvZa8QjzXDZVKXCOltmAH/k7cBiw8DuUbuLl8vd U9zXQACtwkS46IQZhcKRStL3dYwnUaOKq3kkcCgN82mdNt3TVLTnlt47UxWAu9XLDdpa AZFN6s+E417oxY+LMhM/nahvVJHCUZKd32i5XXYar3OoSMDd8aJ+FQyeDfKdynl/mHru V/kQGnnIqQ5MUErOpoVvhHPVZrMfEHYd7fVX9EhIDNtDkgVtcue+xggYPq02H5nP+e7L 1p6A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728936260; x=1729541060; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UpLMikWzCXw4PnwYiCXRmC/z1d4sOwk4bKPiCw/jpho=; b=AfYdkb+nOSAVZVLm6SEYxhba69kktdoCIAa/GSdc0+5C+cGVBY4ay+s2PmXFIcQT6d t0KPc30785S6syD1aPV5q1Uko1I2hMovDVCKYWQgzMDZkyofLD33DT5AlOlJHfp4mHHV icCvhxFJ0dz2w2utp3ZhkTw8UnlNYsrcxof8QQcqkvT1Fq4H5H1AYLVWURP7I/Nhfr9j W3Ulupd2GFEe5XlsIzfA7kxyD4MkWcf1Ki0K+MRBHMCR82mPd0YHPSV6bz9IJKQCFxMJ kuOUc4FJZYUBV/ABdcQR5Ck0wTl++IJHJmwa+KXdmCXtciuy9HYo7BjIzw0v1YPOz+39 yjZg==
X-Forwarded-Encrypted: i=1; AJvYcCUGDxFJzUM3rwX4awzZ9ybFY6I3UPCXf0yH05qDUPpNfJ22lUjpfQ3JeIoLp/0jYMYkkBAW8wlUbQYxhfKQDHDpMaUmIwF9@ietf.org, AJvYcCXKA3s5+m4aOgbHUhfbQAXqF6SsX9yjwt4nJ3cFrOBvfQ4v1xAih8N5/VPQNUHc8VT4oS/BaStZ@ietf.org, AJvYcCXcRJTRzJu1Wmz+TMVQET2/nUjlPSNf5an26nK8AT4igx85Nj5gsHnWw+Mb8N0dvLsJsR4vZRRQt6tR@ietf.org
X-Gm-Message-State: AOJu0YxWM3xNLTsaFwQD3/phZjXhkRGTesEorK+a6QISL2cM5q9c2fPS RgeP83LBNSSb/xT2POx132AHlGqJRAARPD+AN8fnokWyvBchAsxS
X-Google-Smtp-Source: AGHT+IG7nV2o3dCcD4azaztqGYcyyk17Ie/NoNgZ1Gw0f1nHuORe/t3uCnJEbM1nE1+frT05w3MZBA==
X-Received: by 2002:a17:902:c952:b0:20c:890c:2f76 with SMTP id d9443c01a7336-20cbb19aa49mr141162005ad.16.1728936259709; Mon, 14 Oct 2024 13:04:19 -0700 (PDT)
Received: from ?IPV6:2404:4400:541d:a600:44b7:2c2e:2bc6:8707? ([2404:4400:541d:a600:44b7:2c2e:2bc6:8707]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c8c213028sm69293575ad.208.2024.10.14.13.04.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Oct 2024 13:04:19 -0700 (PDT)
Message-ID: <20e04824-60f5-41db-9a78-04681d2bb29d@gmail.com>
Date: Tue, 15 Oct 2024 09:04:14 +1300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: Eliot Lear <lear@lear.ch>, David Schinazi <dschinazi.ietf@gmail.com>, Watson Ladd <watsonbladd@gmail.com>
References: <CACsn0ckfrAfi8HkKexqrFj6OisqFcYYN55L4OXuG0mxXJt1J3g@mail.gmail.com> <a85a3890-c954-4a5e-be2d-a6415cb3f2da@gmail.com> <CABcZeBMLcDHQOVs+bdu8eOEe5W++o=iSCqbLq7JVpcAM=XjtxQ@mail.gmail.com> <bf7ba131-98cd-492a-8ca5-04abe36dec86@gmail.com> <CACsn0cnsXK83qDsaaTe0xpxbO2t5xcQm1emgGuVzXMo=oaKGZQ@mail.gmail.com> <CAPDSy+6Nb959S6prDaNz7CsGvck_EuvLTNRtUYi+bdD8wedYyw@mail.gmail.com> <cb628048-040b-4aae-b903-f366b077c9c7@lear.ch>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
In-Reply-To: <cb628048-040b-4aae-b903-f366b077c9c7@lear.ch>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: base64
Message-ID-Hash: AAAO3LUQEOZ6NVNB6OL4PLDPUUIEMAAK
X-Message-ID-Hash: AAAO3LUQEOZ6NVNB6OL4PLDPUUIEMAAK
X-MailFrom: brian.e.carpenter@gmail.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-secdir.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: secdir <secdir@ietf.org>, draft-eastlake-fnv.all@ietf.org, last-call@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [secdir] Re: [Last-Call] Re: Re: Secdir review of draft-eastlake-fnv
List-Id: Security Area Directorate <secdir.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/secdir/n4819ywrNDTp3J5MJaMX0vjah2k>
List-Archive: <https://mailarchive.ietf.org/arch/browse/secdir>
List-Help: <mailto:secdir-request@ietf.org?subject=help>
List-Owner: <mailto:secdir-owner@ietf.org>
List-Post: <mailto:secdir@ietf.org>
List-Subscribe: <mailto:secdir-join@ietf.org>
List-Unsubscribe: <mailto:secdir-leave@ietf.org>

On 15-Oct-24 07:50, Eliot Lear wrote:
> I said this privately, so I guess I'll ask it publicly:
> 
> Is there value in a BCP to discuss what hash should be used in what circumstances?

TL;DR: Yes.

I was quite surprised to discover that there was no such document when we drafted RFC 6437. And even more surprised recently when seeing this thread.

     Brian

> 
> Eliot
> 
> On 14.10.2024 20:42, David Schinazi wrote:
>> I think there's value in publishing this document, but I agree with Watson
>> that we should improve its security recommendations.
>>
>> Back in 2019, Google servers took some damage from a DoS attack that was
>> inducing collisions in our QUIC connection ID hash table. Our solution was
>> to use SipHash for that hash table, with a random key generated at process
>> startup. SipHash is fast enough that we found it usable for a hash table
>> that is queried on every single QUIC packet received by the Google Front End.
>>
>> The draft currently mentions this issue in its security recommendations
>> subsection about collisions [1], but it currently recommends still using
>> FNV1a with an unknown offset_basis as the solution. I think this
>> section should instead recommend using a cryptographic hash for such
>> use cases.
>>
>> David
>>
>> [1] https://datatracker.ietf.org/doc/html/draft-eastlake-fnv-20#section-7.2
>>
>> On Mon, Oct 14, 2024 at 11:06 AM Watson Ladd <watsonbladd@gmail.com> wrote:
>>
>>     On Sat, Oct 12, 2024, 6:26 PM Brian E Carpenter
>>     <brian.e.carpenter@gmail.com> wrote:
>>     >
>>     > Thanks.
>>     >
>>     > [0] is now at http://www.usenix.org/events/sec03/tech/full_papers/crosby/crosby.pdf
>>     > and is considerably easier to understand than what I found.
>>     >
>>     > I'm sure a warning can be crafted that is not as global as "usage in new applications and
>>     > protocols".
>>
>>
>>     The question is out of all the hash functions why FNV over SipHash, or
>>     Murmer, or an e-universal hash that will be faster. FNV only processes
>>     one byte per mul and xor, which is pretty slow, and can't easily be
>>     parallelized or vectorized the way more principled universal hash
>>     functions can be.  A lot of applications mentioned in the draft are
>>     ones where collisions are observable by an attacker and could be
>>     problematic.
>>
>>     We do need some sort of guidance and improvement in the security
>>     section, but that can be more crafted.
>>
>>     Sincerely,
>>     Watson
>>
>>     >
>>     >
>>     > Regards
>>     >     Brian Carpenter
>>     >
>>     > On 13-Oct-24 12:22, Eric Rescorla wrote:
>>     > >
>>     > >
>>     > > On Sat, Oct 12, 2024 at 1:05 PM Brian E Carpenter <brian.e.carpenter@gmail.com <mailto:brian.e.carpenter@gmail.com>> wrote:
>>     > >
>>     > >     On 12-Oct-24 09:10, Watson Ladd wrote:
>>     > >      > Dear all,
>>     > >      >
>>     > >      > I have reviewed this document as part of the security directorate's
>>     > >      > ongoing effort to review all IETF documents being processed by the
>>     > >      > IESG. These comments were written primarily for the benefit of the
>>     > >      > security area directors. Document editors and WG chairs should treat
>>     > >      > these comments just like any other last call comments.
>>     > >      >
>>     > >      > The summary of the review is Not Ready.
>>     > >      >
>>     > >      > The draft does a good job of describing the FNV-1a hash function.
>>     > >      > However, it falls short on recommending when it should be used and
>>     > >      > when it should not be. Python had to change away from FNV-1a due to
>>     > >      > collision attacks leading to DoS (https://peps.python.org/pep-0456/ <https://peps.python.org/pep-0456/>,
>>     > >      > https://www.youtube.com/watch?v=Vdrab3sB7MU <https://www.youtube.com/watch?v=Vdrab3sB7MU>). The offset is
>>     > >      > insufficient to solve this problem. FNV-1a is slower than other hash
>>     > >      > functions with better guarantees of equidistribution, taking one
>>     > >      > multiply per byte and is hard to parallelize. I think this draft needs
>>     > >      > to say these things, and advise against usage in new applications and
>>     > >      > protocols.
>>     > >
>>     > >     Isn't that a bit too wide? It took me a while to track it down, but
>>     > >     it seems that the original exposition of this problem is at
>>     > > http://events.ccc.de/congress/2011/Fahrplan/attachments/2007_28C3_Effective_DoS_on_web_application_platforms.pdf <http://events.ccc.de/congress/2011/Fahrplan/attachments/2007_28C3_Effective_DoS_on_web_application_platforms.pdf>
>>     > >
>>     > >     That seems too narrow an attack to justify avoiding it in *all*
>>     > >     new applications and protocols. The whole world is not HTTP POST.
>>     > >
>>     > >
>>     > > There certainly are other instances of this class of attack. Here's
>>     > > the earliest publication that I'm aware of from Crosby and Wallach
>>     > > 2003 [0]. In general any time you have a system that deterministically
>>     > > stores attacker provided data under a lookup key controlled by the
>>     > > attacker, you have the potential for this type of algorithmic
>>     > > complexity attack. It's not just Python either, Rust hash tables are
>>     > > constructed using a keyed hash [1].
>>     > >
>>     > > -Ekr
>>     > >
>>     > > [0] https://www.usenix.org/conference/12th-usenix-security-symposium/denial-service-algorithmic-complexity-attack <https://www.usenix.org/conference/12th-usenix-security-symposium/denial-service-algorithmic-complexity-attack>
>>     > > [1] https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.get <https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.get>
>>     > >
>>     > >
>>
>>     -- 
>>     last-call mailing list -- last-call@ietf.org
>>     To unsubscribe send an email to last-call-leave@ietf.org
>>
>>
>