Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71986 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57968 invoked from network); 2 Feb 2014 10:19:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2014 10:19:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.67 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.67 smtp67.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.67] ([108.166.43.67:42092] helo=smtp67.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/D6-30967-A9B1EE25 for ; Sun, 02 Feb 2014 05:19:07 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 1AB83148241; Sun, 2 Feb 2014 05:19:04 -0500 (EST) X-Virus-Scanned: OK Received: by smtp1.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id AA72014823E; Sun, 2 Feb 2014 05:19:03 -0500 (EST) Message-ID: <52EE1B97.2090507@sugarcrm.com> Date: Sun, 02 Feb 2014 02:19:03 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Yasuo Ohgaki , Sara Golemon CC: "internals@lists.php.net" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Improve HTML escape From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > They don't explain as code. AFAIK This is the case for generating invalid > HTML that destroys HTML tag structure. > > > htmlentities() is no good for encoding unquoted tags. This is obvious since it does not encode space and space is a significant character with unquoted tags. So if you have code like the above, it's game over for you, no need to do anything further. > As long as user don't have other mistakes, it's not a security issue. It's > not vulnerable by itself, but it may be possible do some bad thing on some > implementations. It's just a precaution. It's good precaution as it does > not break any existing browsers. IMHO. I don't see any reason so far to do this. The code above is broken with and without quoting /, and quoting / adds nothing to its security as far as I can see. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227