Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83649 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53314 invoked from network); 24 Feb 2015 10:40:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2015 10:40:27 -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.192.48 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.192.48 mail-qg0-f48.google.com Received: from [209.85.192.48] ([209.85.192.48:63049] helo=mail-qg0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/92-37184-9155CE45 for ; Tue, 24 Feb 2015 05:40:26 -0500 Received: by mail-qg0-f48.google.com with SMTP id a108so29023531qge.7 for ; Tue, 24 Feb 2015 02:40:22 -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:content-type; bh=rFtWS6Ala2Xz//gcoIZYAMr/xMKtsn8JRxVvfyPEY+M=; b=iAW9RA0x2EGPQyrKdA4YW6Ezwx/f41PnVWF0u1xsLoFBhm+Lg56HeBXwLUwrzQmCoS VZkTAD3TYAZRp0D74r9XO7idl8z7cJYfhGgzpaft8RyEF504uhuB3cjB61WKS5pMV9q6 CMTmCNxImWoVCbH0xU5NCmDeUM8aJZSYggE41V3xO5y6/O4j7beEPiptvvun8oMIxsYF MDCkaWR/KLLqVbXFC7C0hkKxhUWnR7T3vV3GKpmfT7QNuQ9FW845HEQ7gQGvRvTzjIF8 B4xfyifWZGauHaBHK73zKXI6UAfyTX1PH24xe1eQd/+3p2FCg0H0ZUDrOHQ78WRRM8Sf XnVQ== X-Received: by 10.140.201.8 with SMTP id w8mr23855360qha.51.1424774422200; Tue, 24 Feb 2015 02:40:22 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.198.8 with HTTP; Tue, 24 Feb 2015 02:39:42 -0800 (PST) In-Reply-To: References: Date: Tue, 24 Feb 2015 19:39:42 +0900 X-Google-Sender-Auth: RoTmLgN81ghwEvxEi6YeIR_sqpk Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11432238520991050fd32556 Subject: Re: [RFC] Script only include/require From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11432238520991050fd32556 Content-Type: text/plain; charset=UTF-8 Hi all, On Tue, Feb 24, 2015 at 7:20 PM, Yasuo Ohgaki wrote: > On Tue, Feb 24, 2015 at 4:00 PM, Dmitry Stogov wrote: > >> 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(). >> > > Thank you for the comment. > > I'm not a security expert, but I think that adding check for script >> extension won't add significant level of protection. >> > > I agree. For developers who have more than average skills, this RFC > would not be helpful. File inclusions by readfile()/etc are fatal as well > also. Users must be careful anyway. > > My objective is to reduce risk of server takeover by script inclusions > as low as other languages and being nice to new developers. I've audited > number of web applications written by various languages, there aren't much > difference in programmers' skills. My samples are too few and do not > represent actual figures, but we'll have less vulnerable PHP apps by this. > IMHO. > I would like to show one common example that is unique to PHP. https://www.google.co.jp/search?q=Exif+Webshell+Backdoor This RFC prevents this type of attack effectively. All users has to do is "checking file extension is image". Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11432238520991050fd32556--