Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82006 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49430 invoked from network); 6 Feb 2015 04:09:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2015 04:09:30 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.176 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.176 mail-qc0-f176.google.com Received: from [209.85.216.176] ([209.85.216.176:46088] helo=mail-qc0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 24/E0-45146-97E34D45 for ; Thu, 05 Feb 2015 23:09:29 -0500 Received: by mail-qc0-f176.google.com with SMTP id c9so10062270qcz.7 for ; Thu, 05 Feb 2015 20:09:27 -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=IxZixmCnOR/j21lBImOdj5vFetCeSwB1AvgeeDdUlbM=; b=CCl4Fdfrzh0m26aEehtY8zUmifZTY9exePgJKBdT+RULo1xMGugBLyBh7AADjw2YYU 5dX3KIRmiAF8BYdpefpbguelqW3SKbIS/iolBx4r6Z0Gi0PBBk348ZcILMi9LEj5xsTF ys8mzR9czAOEEiDCvAkQ3ErqdaQDuvKIr3Fn14TWktRZJLdj1KQePSbl4AptvpM40fQo vIWbbA1KA2ewGny/MAwHHuI5jJkc5A9owHup7nYRknEA0pw6rYfX/BhAiXvNwErhY9sm ldSmviOkcufQK0CMzhlNcerK0Eq83ARlQ0CsXdLxB1dN9Gp9zmBKCTqFulwofuIZCUQV Y1xw== X-Received: by 10.224.28.198 with SMTP id n6mr3983398qac.15.1423195767262; Thu, 05 Feb 2015 20:09:27 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.28.72 with HTTP; Thu, 5 Feb 2015 20:08:46 -0800 (PST) In-Reply-To: References: Date: Fri, 6 Feb 2015 13:08:46 +0900 X-Google-Sender-Auth: qalUANncLmnyVmsK0-UB7lZRlE0 Message-ID: To: Pierre Joye Cc: Adam Harvey , PHP internals , Leigh , reeze Content-Type: multipart/alternative; boundary=001a11c2cc9a2753be050e63960f Subject: Re: [PHP-DEV] Re: [RFC][DISCUSSION] script() and script_once() From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c2cc9a2753be050e63960f Content-Type: text/plain; charset=UTF-8 Hi Pierre, On Fri, Feb 6, 2015 at 12:40 PM, Pierre Joye wrote: > > Even if uploaded files are stored under non web root dir, attackers can > use > > path > > traversal or even full path with bad code. As long as PHP can access, > > attacker > > can access to files for inclusion attacks. Compression/encryption > prevents > > attack files executing via script()/require(). Does this answer to you? > > Not really. One will have to use exec and call php and the desired > file as a well configured server won't allow exec of php in the upload > or tmp dir, via the web server. It does not mean they are outside a > web doc root, only that no php (or other) will ever be executed from > there. > With SElinux, we can restrict access. However, PHP should be able to read/write uploaded files. PHP just read and execute them with include. Is windows possible to prevent PHP to load script and execute? While allowing write/read access? I have similar idea for PHP to have data only dirs. > > Also PHP is one part of the big picture, so I will simply summarize it > as "as long as one can access" instead of "as long as PHP can access". > That says all we need to know about emulating (badly anyway) OS > security features in PHP. > > > I realized that I didn't think of byte compiler format. I have to > research > > it. > > IIRC, Zend allows to have custom script loader. > > Could anyone give some pointers to look around? or give some ideas? > > PHK and Phar f.e. Thank you. I'll check PHK. I guess I should check Zend product, too. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c2cc9a2753be050e63960f--