Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71971 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24163 invoked from network); 2 Feb 2014 03:32:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Feb 2014 03:32:04 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.53 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.215.53 mail-la0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:53944] helo=mail-la0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/31-30967-23CBDE25 for ; Sat, 01 Feb 2014 22:32:03 -0500 Received: by mail-la0-f53.google.com with SMTP id e16so4590561lan.12 for ; Sat, 01 Feb 2014 19:31:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=KOMcG6fEJw996oJcokB3tVFv03PVIoeLGTOhpaqaU4U=; b=fIYwDspxC0TjnolF2vpzErZhg5Caq8ebkII35+TkItu1wmgdOaEZu16jPWe65iXsun f2emUXtlXO/S/Q1BLNDwYbPtf7mzGNt/FWDWFmU/RVBP/XeIJ8aJn3l34OL9hyA/LIVw D94GvHW78BU/ACkMkqba55RTSNyCUjUcKjX+2MUZHyzZTYRojx3J/5I3A/fIDViVyMbE HZ2GlL7lU6+bUhJoeZTTzUYM+K/v/oPx3K/Il1kWxnWZL2ahNYE7W/7987M9ay2I1Gs9 8M5j+1iDYUpBXUZuxzdJcvb7Aqw+oOgqwq8vyGTZanPaRcDO86L20X7qkPaN8tWdOn8x 5w+g== X-Received: by 10.153.8.225 with SMTP id dn1mr8202257lad.17.1391311919491; Sat, 01 Feb 2014 19:31:59 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Sat, 1 Feb 2014 19:31:19 -0800 (PST) In-Reply-To: References: Date: Sun, 2 Feb 2014 12:31:19 +0900 X-Google-Sender-Auth: anN5mvfGqEKgCmIQ13S0dkmGGlE Message-ID: To: Sara Golemon Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a1136dfc6bbb0c104f1640cfc Subject: Re: [PHP-DEV] [RFC] Improve HTML escape From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a1136dfc6bbb0c104f1640cfc Content-Type: text/plain; charset=UTF-8 Hi Sara, On Sun, Feb 2, 2014 at 12:15 PM, Sara Golemon wrote: > On Sat, Feb 1, 2014 at 7:09 PM, Yasuo Ohgaki wrote: > > This is a little improvement for HTML escape. > > https://wiki.php.net/rfc/secure-html-escape > > > > "/" escape is recommended by OWASP and we may follow them. > > > Could you include some samples of malicious input and what the output > would actually look like? It's not obvious from the RFC or the link > referenced. They don't explain as code. AFAIK This is the case for generating invalid HTML that destroys HTML tag structure. > When $str is sometext / Produced HTML would be and tag is closed. The code is broken in first place since attribute must be enclosed by "(HTML5/XHTML) or '(HTML4), but many (if not most) browsers just allows attributes without qoutes. 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. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a1136dfc6bbb0c104f1640cfc--