Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72151 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80854 invoked from network); 3 Feb 2014 22:32:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2014 22:32:02 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.178 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.178 mail-lb0-f178.google.com Received: from [209.85.217.178] ([209.85.217.178:59897] helo=mail-lb0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/3D-35654-FD810F25 for ; Mon, 03 Feb 2014 17:32:00 -0500 Received: by mail-lb0-f178.google.com with SMTP id u14so5927787lbd.9 for ; Mon, 03 Feb 2014 14:31:56 -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=EGCbT9gm1vSroxG2BJl0ibUlEqHfus3hTXEWY6X3ljI=; b=ip6sTOU68D9APqjiLIYdYpvxAi4WhWY+ucaDOQrJ5EzIuzzI7zd11SI66xZa5WKuUf cBPnr4KSfXFS2ZCCO3hHRrAkNImVIDB+hqkWukHDPE+9Yhn28HS/WBsw+d6ZTq5BvWVs 3NMhsGnGK7Zidr/nmg/RPRxzLlygX+V5dcdwXh8Myd4YbdvkHpgA4hBOI6S8bLL4nXxg RtftDKnK4w/EF2ygA+xZ7ds6KWFpRMHAhyHw0cF53xtojYmfa9b+kw25eg+4MISYE54v ETBiEEKdYeQQSxxRJwzdLl+J55TEinwlLVAJKh5tMyshuN9FqHdiMeOssdLcnxLL6JMd ucMw== X-Received: by 10.152.4.99 with SMTP id j3mr3545222laj.31.1391466716591; Mon, 03 Feb 2014 14:31:56 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Mon, 3 Feb 2014 14:31:16 -0800 (PST) In-Reply-To: <52F01716.2040304@sugarcrm.com> References: <52EDBB30.3070209@ajf.me> <52EE1C2B.7030702@sugarcrm.com> <52EF50B6.1030404@sugarcrm.com> <52F014C3.4060007@sugarcrm.com> <52F01716.2040304@sugarcrm.com> Date: Tue, 4 Feb 2014 07:31:16 +0900 X-Google-Sender-Auth: 2ENITyfXE66WTSmSEZxkAaKfUpw Message-ID: To: Stas Malyshev Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0141a0a05bfa7004f18817ba Subject: Re: [PHP-DEV] [RFC] Improve HTML escape From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0141a0a05bfa7004f18817ba Content-Type: text/plain; charset=UTF-8 Hi Stas, On Tue, Feb 4, 2014 at 7:24 AM, Stas Malyshev wrote: > > I've already written the URL to OWASP. > > > > PCI DSS v3 states in section 6.5 > > > > Develop applications based on secure coding guidelines. > > Secure coding guidelines in this case is to not use htmlentities in this > context. If you already violate this requirement, why would you expect > PHP to un-violate it for you? I'm lost here. OWASP suggests to escape at least & --> & < --> < > --> > " --> " ' --> ' ' not recommended because its not in the HTML spec (See: section 24.4.1) ' is in the XML and XHTML specs. / --> / forward slash is included as it helps end an HTML entity https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content I'm not sure why you state "already violate this requirement". Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0141a0a05bfa7004f18817ba--