[Cellar] Security considerations: recursive elements

Michael Bradshaw <mjbshaw@google.com> Wed, 17 January 2018 20:33 UTC

Return-Path: <mjbshaw@google.com>
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 8C6B112E898 for <cellar@ietfa.amsl.com>; Wed, 17 Jan 2018 12:33:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.71
X-Spam-Level:
X-Spam-Status: No, score=-2.71 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 pixsrCyXOyqQ for <cellar@ietfa.amsl.com>; Wed, 17 Jan 2018 12:33:55 -0800 (PST)
Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (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 AC46C127275 for <cellar@ietf.org>; Wed, 17 Jan 2018 12:33:39 -0800 (PST)
Received: by mail-it0-x22a.google.com with SMTP id b5so10780417itc.3 for <cellar@ietf.org>; Wed, 17 Jan 2018 12:33:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=y6/2XpVJ+iicGPNIIxNrTjQYRYiUzJkkKtrmQFdiMtQ=; b=XScdZb1giAlX25ljK/a5WNzoUZTLL+OoutSOBTMVVNd1GB9+jb88uNeNUvDXG0ErfT uJGD3hiU/1slkZNO9VA5gKyfGppsvXeVUvOKKvL9OZWUd/TLJ/25/+A4DZ90znJD0bh7 yHmU7Av7NIdXz29uk00I6UlkJTSJNG3T8AjUtmA0cUbf8ed+WImdVNoYtHA67xNZYTJ9 ddJifydgoeAu93prrOFp06+SuLlqclG8uQ5u890of4wjudUcd69T3Qeyxmdntr/Aldqb 2FeWv/BYMn5pWdiCHK2bbG0/ShU0yjSTSDJnrjafa59c2u1DpEPtfLwFUmwE8z/zqhri LUPA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=y6/2XpVJ+iicGPNIIxNrTjQYRYiUzJkkKtrmQFdiMtQ=; b=qaQ3Qouuh9IXRtgu0nCc5QH34c+ENor8nbRpmo3PMrAg/qiOXiR31ypZ2Az08uCy/k s2Ix+Ei78+vmqUnDGQFJU8Mg6EHQzYlp/Ex+0ZMVQWOD2xaficiuqXeJxE68F6ewqJ7e 3knNwO3CrEK+9hM9LgPadR1fuG6S9QCtvs1E3mRe7nrn/XsJtJ1vkg/SBV2hz8o6w7iE 4RdmqOcsW/OeSKCfrUlA4eJxr3MGZxUZdhFLUQsI5ptfXprNZhVY2+tM2kxvnUINK8ss RsmVBxv+r5Y6HFbsUC2RZq5R5NyFd+DhkKBCEMZGfByBqiP7nEwR30tZ9faG+fKCvO7+ OuUA==
X-Gm-Message-State: AKwxytc+qpnwBB5I2bCiGV7K2lDjA7kJfZsPlf87r6YEptlDV75yme9z RpNt17JhHSVnA/q4XeHZjGpsM6l8CbZDRBHJGYiC+Zl+
X-Google-Smtp-Source: ACJfBovA8CsIwboy7JwJiCbYma7Va0ywkVdUFiUD5ImIg6chmKH0ek66fueL7yVv7ulJkRXSBvnwqxWn4Az682la00c=
X-Received: by 10.36.111.4 with SMTP id x4mr12457964itb.133.1516221218483; Wed, 17 Jan 2018 12:33:38 -0800 (PST)
MIME-Version: 1.0
Received: by 10.79.36.75 with HTTP; Wed, 17 Jan 2018 12:33:17 -0800 (PST)
From: Michael Bradshaw <mjbshaw@google.com>
Date: Wed, 17 Jan 2018 12:33:17 -0800
Message-ID: <CAHUoETL6+2XokNy5skB7dzjuzowoL8kV9gNLgd6HeJYiZcXpOQ@mail.gmail.com>
To: Codec Encoding for LossLess Archiving and Realtime transmission <cellar@ietf.org>
Content-Type: multipart/alternative; boundary="001a1144965a21d35b0562fec36f"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cellar/B8CZisxQzGbyBdGfnMG4xFDvCJY>
Subject: [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 20:33:59 -0000

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".

Thoughts from others?