Re: streamid attack

Ian Swett <ianswett@google.com> Thu, 02 January 2020 14:56 UTC

Return-Path: <ianswett@google.com>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C4ECD12007C for <quic@ietfa.amsl.com>; Thu, 2 Jan 2020 06:56:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -17.5
X-Spam-Level:
X-Spam-Status: No, score=-17.5 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.com
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 b2MHXV9HeZ2v for <quic@ietfa.amsl.com>; Thu, 2 Jan 2020 06:56:13 -0800 (PST)
Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D97D912004F for <quic@ietf.org>; Thu, 2 Jan 2020 06:56:12 -0800 (PST)
Received: by mail-wm1-x335.google.com with SMTP id b19so5774893wmj.4 for <quic@ietf.org>; Thu, 02 Jan 2020 06:56:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k9mOv5VSPWVinVzsXZJ4CQC2OWBUuQx8MZHmD6Aqoxw=; b=s3nn2wREl2BEFcG0lGvwM/AymfnKeyHZUVpNRHrUdGiO6Qnv+yRjphXDaTbWF9WJkg bJfQyTnunma7zJn7ypWbMfIAJE4N8fu+cq4mDqmuzZOuIbvoegFDFp4KLTyovr2/c165 +65ysZvPyCGOykB7xxd+2D9qzsEugFo/YFQ50pre8QeHxT7B+sfakNlIinDY5jKxbedM qIRt7Vjyti7t8Jc6s63joa6uwyfQ6u9eNvMg5bJMO36fwE0dAN9Qbwkkxd5Xv1e/PrTo Xlb53/0MwkM2NcnMH2UuJQ0mToG+eLChqjZdL3NZreFpXcfGk/04MBnS9RpP242lBYz4 lo1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k9mOv5VSPWVinVzsXZJ4CQC2OWBUuQx8MZHmD6Aqoxw=; b=BC619OSnyMIKmctClpk1WSiVj/Qm0gsRd2sawhx7d82+/l39oc54IWqj0e9pUYJnsQ urxIylmvNrh82HIB+xC6+EsnpWKTd3W2+6CKBlxbSY9t/nfbc+70t7rBzdNoUe/NM/kr gOkIXZvqNRYP7566D4dPsH1HrBgPNJZo17pA9hG6mPQ8+tNWbRmYYCq/LmBNcOHWV4ql zezTya5tUosjf4RuUuoUtI8Nte/7/2AYiEqPH3AtYXm97dBSejKdXUC7zOz1T5eRlzHr YJBPNmbQgm683c1bKSFFJiu+KPvS9SpnIE1NaglDNOOVnc2ph4V6/oBtvfeZHUp/mpKE eS7Q==
X-Gm-Message-State: APjAAAXA453H3WFUU0/GxOc7fKWsdmXwZT5YszwRjWnpzYPoVlr354pF iPzGlyFrthAsmZArneAys0JD9/kReGQKJyJZCM7iEQ==
X-Google-Smtp-Source: APXvYqwDdyh9bkB7VU9YpS2qiTCHLNrLNoV+kU+E9tZ+mD0J79727iU6VNfDMvxTK3hii6RIFdIi3/4oJOVtyNExyQ0=
X-Received: by 2002:a05:600c:210b:: with SMTP id u11mr14795117wml.43.1577976971114; Thu, 02 Jan 2020 06:56:11 -0800 (PST)
MIME-Version: 1.0
References: <CAG9+TpbkAYm5GNZJvj6W8GT8pAxnh_9RnoPbwNUdVqDnCtSLCg@mail.gmail.com>
In-Reply-To: <CAG9+TpbkAYm5GNZJvj6W8GT8pAxnh_9RnoPbwNUdVqDnCtSLCg@mail.gmail.com>
From: Ian Swett <ianswett@google.com>
Date: Thu, 02 Jan 2020 09:55:58 -0500
Message-ID: <CAKcm_gPVNbeBA5J0et83eoCfDBTjb3FnUyUoG_DHaTWgm=VK+w@mail.gmail.com>
Subject: Re: streamid attack
To: Jiuhai Zhang <jiuhai.zhang@gmail.com>
Cc: IETF QUIC WG <quic@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000d45936059b296465"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/ED1x9ejaoqpEt7cO_1tsE6fwhNA>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 02 Jan 2020 14:56:15 -0000

This is avoided by limiting the number of open streams with MAX_STREAMS.
If you're willing to let the peer open a certain number of streams, the
only 'attack' is that it's lower cost to do it with a single frame.

I'll note there are ways to reduce the state associated with these 'open',
but not yet referenced streams to a few bytes(ie: a hashmap entry), and
that sort of accounting would have to be done whether you consider them
open or closed.

I believe it made some implementations simpler to assume they were opened
once a higher number was referenced, but I don't have a link to the
relevant issue on hand at the moment.

On Thu, Jan 2, 2020 at 8:33 AM Jiuhai Zhang <jiuhai.zhang@gmail.com> wrote:

> In 2.1. Stream Types and Identifiers
> A stream ID that is used out of order results in all streams of that type
> with lower-numbered stream IDs also being opened.
>
> Attacker can send a stream frame with a large streamid, then server will
> open a lot of streams. How to avoid this besides flow control? Why we
> should open lower-numbered stream IDs?
>