Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94148 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20344 invoked from network); 20 Jun 2016 10:52:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2016 10:52:01 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.163 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.163 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.163] ([81.169.146.163:8829] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/60-16093-FCAC7675 for ; Mon, 20 Jun 2016 06:52:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1466419916; l=4849; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=dwdAOBdc83k9q3IG0ZA/cb8NQB1wVxEG5IwUAlq6Rig=; b=eKt1Tv4oUoGc+QAF2f7HiBIG3CMd4NFpYW6UtuXlQibg6QDEpYj1unvDU/lqiXgksFX 2aueDNmBB0Lb+bnKfOGmHuTd//DyxsErFkHa8JfEaTUDaL6RUe8GU7KMHuwor37OYMc7t GLIm66eW4xy4FoMjGBNf4P4w87TZ41pceTU= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLGvomb4bl9EfHtO3o6 X-RZG-CLASS-ID: mo00 Received: from mail-wm0-f49.google.com ([74.125.82.49]) by smtp.strato.de (RZmta 38.6 AUTH) with ESMTPSA id 502d46s5KApuYdM (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Mon, 20 Jun 2016 12:51:56 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id 187so6025631wmz.1 for ; Mon, 20 Jun 2016 03:51:56 -0700 (PDT) X-Gm-Message-State: ALyK8tJOn5yvZ0IfOYhSphTHiNoUeDwEFxbS54XfOIdng6LLTAc84FLCiQtehfnNT6CI2FRNYkm4/xI30Dquvg== X-Received: by 10.28.92.66 with SMTP id q63mr10943281wmb.73.1466419916416; Mon, 20 Jun 2016 03:51:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.199.67 with HTTP; Mon, 20 Jun 2016 03:51:55 -0700 (PDT) In-Reply-To: <5767B388.8060807@lsces.co.uk> References: <20160617202344.2868F1A80C02@dd1730.kasserver.com> <57665E36.60302@lsces.co.uk> <5766D311.6030503@lsces.co.uk> <5766FA91.60803@lsces.co.uk> <5767B388.8060807@lsces.co.uk> Date: Mon, 20 Jun 2016 12:51:55 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Lester Caine Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a114687ea35b3830535b37efc Subject: Re: [PHP-DEV] New escaped output operator From: me@kelunik.com (Niklas Keller) --001a114687ea35b3830535b37efc Content-Type: text/plain; charset=UTF-8 2016-06-20 11:12 GMT+02:00 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! > I read it and I fundamentally disagree with that. > 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'] ... > ' security You're right. But it's the case because it doesn't obey the output context. It's not because it escapes on outpu > when users should be educated as to the risks that NOT > validating data can create. Such as overflowing field sizes and creating > text which internally can cause problem even before outputting to a > browser Data validation is a totally different topic and not what this thread is about. > such as quotes in combined strings. > Where's that an issue? > ( Rowan sums up the output side nicely ... ) > > --001a114687ea35b3830535b37efc--