Re: [Cellar] Security considerations: recursive elements

Michael Niedermayer <michael@niedermayer.cc> Wed, 17 January 2018 22:32 UTC

Return-Path: <michael@niedermayer.cc>
X-Original-To: cellar@ietfa.amsl.com
Delivered-To: cellar@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1678F12EA93 for <cellar@ietfa.amsl.com>; Wed, 17 Jan 2018 14:32:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.62
X-Spam-Level:
X-Spam-Status: No, score=-2.62 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] 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 wUfAefjfZB-X for <cellar@ietfa.amsl.com>; Wed, 17 Jan 2018 14:31:59 -0800 (PST)
Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 34BE712EA8C for <cellar@ietf.org>; Wed, 17 Jan 2018 14:31:59 -0800 (PST)
X-Originating-IP: 213.47.41.20
Received: from localhost (213-47-41-20.cable.dynamic.surfer.at [213.47.41.20]) (Authenticated sender: michael@niedermayer.cc) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id A4C7E172094 for <cellar@ietf.org>; Wed, 17 Jan 2018 23:31:57 +0100 (CET)
Date: Wed, 17 Jan 2018 23:31:56 +0100
From: Michael Niedermayer <michael@niedermayer.cc>
To: cellar@ietf.org
Message-ID: <20180117223156.GD3493@michaelspb>
References: <CAHUoETL6+2XokNy5skB7dzjuzowoL8kV9gNLgd6HeJYiZcXpOQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="UoPmpPX/dBe4BELn"
Content-Disposition: inline
In-Reply-To: <CAHUoETL6+2XokNy5skB7dzjuzowoL8kV9gNLgd6HeJYiZcXpOQ@mail.gmail.com>
User-Agent: Mutt/1.5.24 (2015-08-30)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cellar/a0O5XU_cufA4bqez5EzLvGKsTjw>
Subject: Re: [Cellar] Security considerations: recursive elements
X-BeenThere: cellar@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Codec Encoding for LossLess Archiving and Realtime transmission <cellar.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cellar>, <mailto:cellar-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cellar/>
List-Post: <mailto:cellar@ietf.org>
List-Help: <mailto:cellar-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cellar>, <mailto:cellar-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 17 Jan 2018 22:32:01 -0000

On Wed, Jan 17, 2018 at 12:33:17PM -0800, Michael Bradshaw wrote:
> The EBML and Matroska specs currently don't mention the possibility of a
> stack overflow due to deeply nested recursive elements. Currently, there's
> no limit on the recursion depth (unless I've overlooked it somewhere).
> 
> I think it would be worth adding to the security section of EBML that one
> type of attack on an EBML Reader could include deep element recursion.
> 

> Additionally, I would like to see what people think about potentially
> adding/suggesting an upper limit on recursion (either as a MUST or a MAY).
> This could also include a lower limit too. For example, something like "a
> parser SHOULD handle recursion up to X levels deep, and MAY abort the parse
> if it reaches Y levels deep".

If a limit is specified then theres a limit that every compliant parser
must support and which a compliant muxer can use.

If no such limit is specified then it is possible that in a system where
all parts are specification compliant and otherwise compatible it doesnt work.

So I think its more a question about what/when compatibility is guranteed
/ what compatibility we want the specification to gurantee
from that it follows if we need a limit in the specification/draft or not

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.