Re: [websec] mimesniff feedback

Adam Barth <ietf@adambarth.com> Sat, 26 November 2011 01:42 UTC

Return-Path: <ietf@adambarth.com>
X-Original-To: websec@ietfa.amsl.com
Delivered-To: websec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 17D8421F8AE9 for <websec@ietfa.amsl.com>; Fri, 25 Nov 2011 17:42:15 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.491
X-Spam-Level:
X-Spam-Status: No, score=-2.491 tagged_above=-999 required=5 tests=[AWL=0.186, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, MIME_8BIT_HEADER=0.3, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dPssKUf7lyMj for <websec@ietfa.amsl.com>; Fri, 25 Nov 2011 17:42:14 -0800 (PST)
Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by ietfa.amsl.com (Postfix) with ESMTP id 8111B21F8AD6 for <websec@ietf.org>; Fri, 25 Nov 2011 17:42:14 -0800 (PST)
Received: by iaeo4 with SMTP id o4so6354907iae.31 for <websec@ietf.org>; Fri, 25 Nov 2011 17:42:14 -0800 (PST)
Received: by 10.231.45.9 with SMTP id c9mr655851ibf.73.1322271734162; Fri, 25 Nov 2011 17:42:14 -0800 (PST)
Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by mx.google.com with ESMTPS id a2sm61569053igj.7.2011.11.25.17.42.11 (version=SSLv3 cipher=OTHER); Fri, 25 Nov 2011 17:42:11 -0800 (PST)
Received: by iaeo4 with SMTP id o4so6354854iae.31 for <websec@ietf.org>; Fri, 25 Nov 2011 17:42:11 -0800 (PST)
Received: by 10.50.217.195 with SMTP id pa3mr40162353igc.12.1322271731092; Fri, 25 Nov 2011 17:42:11 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.67.130 with HTTP; Fri, 25 Nov 2011 17:41:40 -0800 (PST)
In-Reply-To: <op.v5h75cn2sr6mfa@kirk>
References: <op.v5h75cn2sr6mfa@kirk>
From: Adam Barth <ietf@adambarth.com>
Date: Fri, 25 Nov 2011 17:41:40 -0800
Message-ID: <CAJE5ia_NgzrsiAzOkLa5dse958TmZmUKBM-+beTubEGC7qw8wA@mail.gmail.com>
To: Philip Jägenstedt <philipj@opera.com>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: websec@ietf.org
Subject: Re: [websec] mimesniff feedback
X-BeenThere: websec@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Web Application Security Minus Authentication and Transport <websec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/websec>, <mailto:websec-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/websec>
List-Post: <mailto:websec@ietf.org>
List-Help: <mailto:websec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/websec>, <mailto:websec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 26 Nov 2011 01:42:15 -0000

On Fri, Nov 25, 2011 at 5:37 AM, Philip Jägenstedt <philipj@opera.com> wrote:
> http://tools.ietf.org/html/draft-ietf-websec-mime-sniff-03
>
> The right column is misaligned for:
>
> +-------------------+-------------------+-----------------+------------+
> | FF FF FF FF FF FF | WS 3C 3f 78 6d 6c | text/xml        | Scriptable |
> | Comment: <?xml (Note the case sensitivity and lack of trailing _>)  |
> +-------------------+-------------------+-----------------+------------+
>
> +-------------------+-------------------+-----------------+------------+
> | FF FF FF FF FF    | 4F 67 67 53 00    | application/ogg | Safe       |
> | Comment: An Ogg audio or video signature.                     |
> +-------------------+-------------------+-----------------+------------+
>
> Typo: "as define in"

This appears to have already been fixed in my local copy.

> In 6.1 "Signature for MP4":
>
> * If implemented naively, it can "segfault" at step "If octets 5 through
> 8..." for n<8.

Fixed.

> * I don't know anything about the MP4 file format, but there's an off-by-one
> error in "If octets 4*i through 4*i + 3 (inclusive)". It seems likely that
> the magic bytes are aligned on 4 byte boundaries and that it should be
> "4*i+1 through 4*i+3". That'll also make the octet count 3, to match "mp4".

I've made all these indicies consistently zero-based and I've added a
note that the indicies are zero-based.

> * The initial check is for n<4, but the algorithm can only return true for
> n>=12. Adjusting that solves the "segfault" as well.

Fixed.

Thanks!
Adam