Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75836 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69615 invoked from network); 22 Jul 2014 11:49:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2014 11:49:02 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.43 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.43 mail-oa0-f43.google.com Received: from [209.85.219.43] ([209.85.219.43:50975] helo=mail-oa0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 68/5E-14611-CAF4EC35 for ; Tue, 22 Jul 2014 07:49:01 -0400 Received: by mail-oa0-f43.google.com with SMTP id i7so9456370oag.2 for ; Tue, 22 Jul 2014 04:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4/ZWcgwK8wC22WJEKc8JumlZzTEL54F89jy4pE5sbnA=; b=njcEog6vCtMhhZS7bqeGWuPdxEZh+DotGv8QAALTY6WhUf+jygSoWo6eH+VptSdKBX uVi+vBSbuKKoUeZwZJQqcueMyvNQOpmfslL75kQe7d0MSQEraCSjxXn0w1mQEESynM+B ueyFgM+B6l7NwMMT2EZKFDAMRaGvdpz59oLfxUNZQ9iMlkcbqx2jZtXWfgFmwo/7UOO2 +kG1RIO80qJ5GMfk7iNHVWz/xui/eD5uk6+rwWNYkP7ZAcMGdHEskgoWSbsuwAjM9Mh/ rmJLKGVlFcP3Ic/TAg82GamZaRYGkWw440Qsrm13FSVDN0TwRf8tbbYJGW7wmmDnYLzK Mvfg== MIME-Version: 1.0 X-Received: by 10.182.243.132 with SMTP id wy4mr48144532obc.38.1406029738172; Tue, 22 Jul 2014 04:48:58 -0700 (PDT) Received: by 10.182.132.2 with HTTP; Tue, 22 Jul 2014 04:48:58 -0700 (PDT) In-Reply-To: References: <53A1C722.9060501@fedoraproject.org> <53A21137.6010705@sugarcrm.com> <53A2A9BD.1070603@sugarcrm.com> <53A3874E.20704@sugarcrm.com> <53A62AFF.4080302@sugarcrm.com> <53B10D59.4060206@sugarcrm.com> Date: Tue, 22 Jul 2014 13:48:58 +0200 Message-ID: To: Ferenc Kovacs Cc: Alexey Zakhlestin , Stas Malyshev , Marco Pivetta , Sebastian Bergmann , Julien Pauli , Remi Collet , PHP Internals Content-Type: multipart/alternative; boundary=001a11c2c25016659204fec6cf9c Subject: Re: [PHP-DEV] Problems with the fix for the BC break introduced in 5.4.29 and 5.5.13 From: nikita.ppv@gmail.com (Nikita Popov) --001a11c2c25016659204fec6cf9c Content-Type: text/plain; charset=UTF-8 On Tue, Jul 22, 2014 at 12:27 PM, Ferenc Kovacs wrote: > sorry for the late reply. > you are right and after looking into the implementation I think classes > having custom object storage (eg. create_object) shouldn't assume that > their __construct will be called, but either do the initialization in the > create_object hook or validate in the other methods that the object was > properly initialized. > given that this lack of initialization problem is already present(you can > extend such a class and have a __construct() in the subclass which doesn't > call the parent constructor), and we want to keep the unserialize trick > fixed (as that exposes this problems to the remote attacker when some code > accepts arbitrary serialized data from the client) I see no reason to keep > the limitation in the ReflectionClass::newInstanceWithoutConstructor() and > allowing the instantiation of internal classes will provide a clean upgrade > path to doctrine and co. > ofc. we have to fix the internal classes misusing the constructor for > proper initialization one by one, but that can happen after the initial > 5.6.0 release (ofc it would be wonderful if people could lend me a hand for > fixing as much as we can before the release), but we have to fix those > anyways. > This sounds reasonable to me. newInstanceWithoutConstructor does not have the same remote exploitation concerns as serialize, so allowing crashes here that can also be caused by other means seems okay to me (especially if we're planning to fix them lateron). Only additional restriction I'd add is to disallow calling it on an internal + final class. For those the __construct argument does not apply. For them the entity-extending-internal-class usecase doesn't apply either, so that shouldn't be a problem. Nikita --001a11c2c25016659204fec6cf9c--