Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83633 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9733 invoked from network); 24 Feb 2015 07:00:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2015 07:00:11 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.180 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.180 mail-vc0-f180.google.com Received: from [209.85.220.180] ([209.85.220.180:58593] helo=mail-vc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/00-09240-8712CE45 for ; Tue, 24 Feb 2015 02:00:09 -0500 Received: by mail-vc0-f180.google.com with SMTP id im6so9366567vcb.11 for ; Mon, 23 Feb 2015 23:00:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=6NUflZfAsherTpvcj2u4+5l+IgV2C0LUEP+w1Ugs2JU=; b=dCvLAfq/go2DY3bKQcWm62yyMKGRpg5s+XfMdvu+ifTpirUHkDFqMoK4QBAAx63Mz/ X9I1ztnDH2I5MZlWUonARaPrtRUfFbSaA8HshCX3kUQg2PCOwuCTpvmOC6TYs+X4/IC5 O/lSCeRwMEdhpYWQVYVL96L+mPWfAEhAdnQMjWwNgbkmlSi90MH6H0PkPV23171OkXtW kuuvN3Sbvs9/t3F6YW4WHG4LVQFu+4cxpi2CcuNRgDugpGQLTe+RPFWXaX3GrO/I2oJi PehAOOk+0G4iCd4Z7WxRrRy1YeykUOLIKd4YTHEBN8mucnn+xN6sP4SuUzYN5MAmbQed itWg== X-Gm-Message-State: ALoCoQkrkUtWNsPSkZwroffB6wNysyvc5CDvxWXO4NYLAW5A2wYi3GKC7PTC/dWGwMlCzSAXlIbjiPfoP00nxXWwsh8UtCeb7lsIoVW57w1ZCEO3liREWs8ru7Lquy5jlVSn82oJfY+dU4hjfOBp6z6jtikpTSPMtg== MIME-Version: 1.0 X-Received: by 10.52.99.230 with SMTP id et6mr14110883vdb.65.1424761202240; Mon, 23 Feb 2015 23:00:02 -0800 (PST) Received: by 10.52.113.231 with HTTP; Mon, 23 Feb 2015 23:00:02 -0800 (PST) In-Reply-To: References: Date: Tue, 24 Feb 2015 11:00:02 +0400 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" , Nikita Popov Content-Type: multipart/alternative; boundary=20cf3071c7c0598907050fd011b8 Subject: Re: [RFC] Script only include/require From: dmitry@zend.com (Dmitry Stogov) --20cf3071c7c0598907050fd011b8 Content-Type: text/plain; charset=UTF-8 On Mon, Feb 23, 2015 at 6:55 AM, Yasuo Ohgaki wrote: > Hi Dmitry and Nikita, > > On Mon, Feb 23, 2015 at 6:23 AM, Yasuo Ohgaki wrote: > >> I wrote patch and made adjustment in the RFC >> https://wiki.php.net/rfc/script_only_include >> https://github.com/php/php-src/pull/1111 >> Where to check filename extension is subject to be changed. >> At first, I thought implementing this as PHP code is good, but >> I've changed my mind. It seems better to be done in Zend code. >> Opinions are appreciated. >> >> This RFC aims to make PHP as secure as other languages >> with respect to "script inclusion" attacks. >> Note: File inclusion is not a scope of this RFC. >> >> INI Changes: >> - "php_script" -> "zend.script_extensions" >> - "Allow all files": "*" -> NULL or "" >> >> Open Issues: >> - Error type - Is it OK to raise E_ERROR/E_RECOVERABLE_ERROR in >> zend_language_scanner.c? >> - Vote type - 50%+1 or 2/3 >> >> If there is anyone who would like to vote "no" for this RFC, >> I would like to know the reason and try to address/resolve issue you have. >> >> Thank you. >> > > We don't have care much about which error is raised from Zend engine, > since there > will be engine exception. > > My questions are, is it ok to raise E_ERROR or E_RECOVERABLE_ERROR from > zend_language_scanner.c? > Use E_ERROR. > > > https://github.com/php/php-src/pull/1111/files#diff-93ad74868f98ff7232ebea00007c8b7fR624 > > Does engine exception catches error from zend_error_noreturn()? > no. it'll be changed into zend_error(). I'm not a security expert, but I think that adding check for script extension won't add significant level of protection. Thanks. Dmitry. > > Thank you. > > Regards, > > -- > Yasuo Ohgaki > yohgaki@ohgaki.net > > --20cf3071c7c0598907050fd011b8--