Re: [websec] #21: sniffing of text/html shouldn't override polyglot label of application/xhtml+xml

Philip Gladstone <pgladsto@cisco.com> Mon, 24 October 2011 17:15 UTC

Return-Path: <pgladsto@cisco.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 773831F0C44 for <websec@ietfa.amsl.com>; Mon, 24 Oct 2011 10:15:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.599
X-Spam-Level:
X-Spam-Status: No, score=-6.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4]
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 SQUQh6rZQqfi for <websec@ietfa.amsl.com>; Mon, 24 Oct 2011 10:15:33 -0700 (PDT)
Received: from mtv-iport-2.cisco.com (mtv-iport-2.cisco.com [173.36.130.13]) by ietfa.amsl.com (Postfix) with ESMTP id 9B12121F8DB9 for <websec@ietf.org>; Mon, 24 Oct 2011 10:15:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=pgladsto@cisco.com; l=1307; q=dns/txt; s=iport; t=1319476532; x=1320686132; h=message-id:date:from:mime-version:to:cc:subject: references:in-reply-to:content-transfer-encoding; bh=FLizzC47rQI5I8SCGmidq554z2E+PfIJAwFnSFoPypQ=; b=B20413wWV3rW6X9LXvVVUSRRTprgi1a7hrkFpjUxBQdMXI522GFJT32z NkMRveJGsCs2cajeHrdKF8ZcxWW+CtDBPhhJLG21q76sV31IQd/FR0M+0 3DDZpg77E/tGoKqb/w3ggFGw1nSPVsQQykeKrC8DfzU2TkU2sA1hrDgjn w=;
X-IronPort-AV: E=Sophos;i="4.69,399,1315180800"; d="scan'208";a="9887985"
Received: from mtv-core-2.cisco.com ([171.68.58.7]) by mtv-iport-2.cisco.com with ESMTP; 24 Oct 2011 17:15:27 +0000
Received: from [161.44.106.139] (dhcp-161-44-106-139.cisco.com [161.44.106.139]) by mtv-core-2.cisco.com (8.14.3/8.14.3) with ESMTP id p9OHFQPr006196; Mon, 24 Oct 2011 17:15:26 GMT
Message-ID: <4EA59D2D.9050905@cisco.com>
Date: Mon, 24 Oct 2011 13:15:25 -0400
From: Philip Gladstone <pgladsto@cisco.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
MIME-Version: 1.0
To: Larry Masinter <masinter@adobe.com>
References: <059.3516e8c3cdad2665b7817e8e50a003a8@trac.tools.ietf.org> <4EA59106.8020702@cisco.com> <C68CB012D9182D408CED7B884F441D4D0605EFA472@nambxv01a.corp.adobe.com>
In-Reply-To: <C68CB012D9182D408CED7B884F441D4D0605EFA472@nambxv01a.corp.adobe.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Cc: "websec@ietf.org" <websec@ietf.org>
Subject: Re: [websec] #21: sniffing of text/html shouldn't override polyglot label of application/xhtml+xml
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: Mon, 24 Oct 2011 17:15:34 -0000

On 10/24/2011 12:48 PM, Larry Masinter wrote:
> I don't understand, Philip. A central case of this document involves taking documents that look like text/html but are labeled as text/plain and "sniffing" them to be text/html after all.
>
> It's claimed that this is necessary, part of most browsers today, regular practice, etc.
>
> Are you opposed to specifying sniffing from text/plain to text/html? In any case?

If the web server explicitly says text/plain, then IMHO it should never 
be sniffed as text/html. Having dealt with security issues where a 
document was returned (without a mime type) and then interpreted as 
text/html, and then enabling a serious XSS, I am attuned to this issue. 
[In my case, this was with a web based ticketing system that allowed the 
submitter of a ticket to upload arbitrary files as supplementary 
information. It turned out that these files were then displayed without 
a content type, and *some* browsers chose to interpret any javascript 
that was embedded. Moving to an explicit text/plain type fixed that 
problem, and these files were displayed literally.]

In the case of sniffing image types when the web server gets it wrong, I 
don't have any experience with what security vulnerabilities that would 
introduce (if any).

Philip