Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94147 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14025 invoked from network); 20 Jun 2016 09:12:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2016 09:12:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.230 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.230 mail4-3.serversure.net Linux 2.6 Received: from [217.147.176.230] ([217.147.176.230:51150] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/E2-25084-B83B7675 for ; Mon, 20 Jun 2016 05:12:44 -0400 Received: (qmail 11329 invoked by uid 89); 20 Jun 2016 09:12:41 -0000 Received: by simscan 1.3.1 ppid: 11322, pid: 11325, t: 0.0872s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.7?) (lester@rainbowdigitalmedia.org.uk@81.138.11.136) by mail4.serversure.net with ESMTPA; 20 Jun 2016 09:12:41 -0000 To: internals@lists.php.net References: <20160617202344.2868F1A80C02@dd1730.kasserver.com> <57665E36.60302@lsces.co.uk> <5766D311.6030503@lsces.co.uk> <5766FA91.60803@lsces.co.uk> Message-ID: <5767B388.8060807@lsces.co.uk> Date: Mon, 20 Jun 2016 10:12:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] New escaped output operator From: lester@lsces.co.uk (Lester Caine) On 20/06/16 07:00, Niklas Keller wrote: >> Now ... I want to add content that includes >> > it needs to be in the format >> > <script>alert("xss")<script> so that it never >> > appears in the 'dangerous' format, but if $user['about_me'] is >> > designated a simple text string, then any attempt to add >> > via an input should be blocked! > > No, it shouldn't be blocked. It should just be escaped on output. What if > that's a comment to a tech blog, where we talk about these things instead > of trying to find a vulnerability? Re-read what I wrote! You should ALWAYS sanitise simple text such as short descriptions, and even user names and other simple text fields and I would always do that with strings like $user['about_me'] ... '