Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66861 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86728 invoked from network); 31 Mar 2013 02:54:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Mar 2013 02:54:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.91 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.91 smtp91.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.91] ([108.166.43.91:43647] helo=smtp91.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4B/01-14957-E55A7515 for ; Sat, 30 Mar 2013 21:54:25 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp4.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id E76261400BC for ; Sat, 30 Mar 2013 22:54:19 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp4.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id A96EA1400B5 for ; Sat, 30 Mar 2013 22:54:19 -0400 (EDT) Message-ID: <5157A55A.1070507@sugarcrm.com> Date: Sat, 30 Mar 2013 19:54:18 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [RFC] more secure unserialize() From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! As many probably know, unserialize() has a security issue following from the fact that you can create objects with data from unserialize(), and these object may have behavior that is invoked automatically - namely __destruct - that can result in unintended results. See e.g. http://heine.familiedeelstra.com/security/unserialize among others for more detailed description. So I propose a modification to unserialize(): https://wiki.php.net/rfc/secure_unserialize that would make one of the common cases - serializing data to be stored on user side or user-accessible side - more secure by avoiding instantiating all object (or all objects not belonging to a whitelist) and keeping them as incomplete objects instead. Comments and suggestions welcome, -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227