Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12306 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46624 invoked by uid 1010); 23 Aug 2004 16:38:13 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 28439 invoked from network); 23 Aug 2004 16:33:32 -0000 Received: from unknown (HELO mail.mbobo.org) (213.133.123.182) by pb1.pair.com with SMTP; 23 Aug 2004 16:33:32 -0000 Received: from localhost (localhost [127.0.0.1]) by mail.mbobo.org (Postfix) with ESMTP id A5CD1574384; Mon, 23 Aug 2004 18:33:30 +0200 (CEST) Received: from mail.mbobo.org ([127.0.0.1]) by localhost (debian [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 07168-10; Mon, 23 Aug 2004 18:33:30 +0200 (CEST) Received: from [10.200.1.55] (adsl-68-120-96-254.dsl.sntc01.pacbell.net [68.120.96.254]) by mail.mbobo.org (Postfix) with ESMTP id DA53D574375; Mon, 23 Aug 2004 18:33:28 +0200 (CEST) Message-ID: <412A1C79.6070903@apache.org> Date: Mon, 23 Aug 2004 09:34:01 -0700 User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Adam Q Cc: Derrell.Lipman@UnwiredUniverse.com, internals@lists.php.net References: <0ADA645E-F4F3-11D8-AC67-0003939D6C78@westnet.com.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at mbobo.org Subject: Re: [PHP-DEV] SQLite security From: sterling@apache.org (Sterling Hughes) There are a lot of ways being a stupid programmer can give you an insecure website. Saying that just because someone is too stupid to properly lock down their data store (put outside the web root, run PHP with proper perms, etc.), makes PHP/SQLite themselves insecure, is like putting coffee on your lap, driving and blaming McDonalds for your burns. - eval($_POST['sterling']); Adam Q wrote: > > On 23/08/2004, at 9:22 PM, Derrell.Lipman@UnwiredUniverse.com wrote: > >> Adam Q writes: >> >>> I think encryption for SQLite is essential for PHP. Without it, it >>> makes it >>> almost useless in a webscripting language. Suppose you wanted to >>> create an >>> open source, easily portable, file based guestbook in PHP. I would >>> never use >>> SQLLite under the current circumstances... Although I would love to. It >>> seems like the perfect solution. >>> >>> The database needs a password.... otherwise it is just too much of a >>> security risk. >> >> >> Others have commented on where the database should (or shouldn't) be >> located >> to avoid these problems. If the server environment is so inadequately >> maintained as to put database files in locations where they might be >> downloaded, then I would contend that it would not be a difficult job to >> manage to download the PHP or other data file which contains the >> username >> > > I can see I've touched a nerve here. > Has nobody d/l PHPNuke, PostNuke, phpMyAdmin, Mambo... On and on the > list goes on? > They all put their DB access data in a file called "config.inc.php" > (or something like that). (ie database passwords and general config data) > But they protect it by including something along these lines: > > //config.inc.php > if (defined("correct_entry_point")) { > my_pref[1] = "lots of good stuff"; > } > ?> > > so even if you know where this file is in your web tree e.g. > http://www.example.com/db_admin/config.inc.php > all you get when you put it into a web broswer is a blank page. > > Is this insecure? Please don't give me a flat yes. > The answer lies behind a thousand veils of shade. > phpMyAdmin consistently is in the top 10 projects on sourceforge. Is > this method insecure? (yes, they drone) Then why do the phpMyAdmin > developers go ahead with it? Because it works. Simple. > PHPNuke has a community in the hundreds of thousands. Is this method > insecure? (yes, yes, yes) > PostNuke ditto? (yes, yes, yes) > Mambo too? (yes, yes, yes) > I've forgotten because there are so many out there on hotscripts.com? > (yes, yes, yes) > > And finally, imagine if I used an SQLite DB to store this data... But > we've been there before. > > Thank you for the information regarding the encryption. I don't have > the knowledge or skills to include this into PHP 5, but I appreciate > the information - for one thing it means I'm not going crazy, other > people have had the same idea. > > Adam >