Live data from Hacker News

1% of CMS-Powered Sites Expose Their Database Passwords (2011)

feross.org

71–80 of 94 posts

Re: 1% of CMS-Powered Sites Expose Their Database Passwords (2011)

#71
As a side note a lot of Wordpress sites do expose the wp-config-sample.php file. See for example the official Yahoo! Blog, The Wall Street Journal, Sony Blog, etc...:

http://ycorpblog.com/wp-config-sample.php

http://blogs.wsj.com/law/wp-config-sample.php

http://blog.us.playstation.com/wp-config-sample.php

...

Re: 1% of CMS-Powered Sites Expose Their Database Passwords (2011)

#72

To protect the wp-config.php file using htaccess is a well known security precaution for any WP pro. The issue however is if you have a copy of said file, in which case protecting the main version would be useless. Also I'd say the blame if you can assign any is on Vim, Emacs, Gedit, and Nano which would have had to crash in order to set these chain of events in motion.

WordPress looks for wp-config.php in the current directory and 1 directory up, so there is no need for any use of htaccess.

Re: 1% of CMS-Powered Sites Expose Their Database Passwords (2011)

#73
Lol. That's just called statistics.

I bet you 1% of every web site or server in existence does something so blatantly and unthinkably wrong that it would make any sysadmins eyes pop out of his head.

1% is in fact extremely low in my opinion—my guess would be closer to 10-15% of sites have some glaring security hole.

The only important thing is to not let it be your site.

Re: 1% of CMS-Powered Sites Expose Their Database Passwords (2011)

#74

Lol. That's just called statistics. I bet you 1% of every web site or server in existence does something so blatantly and unthinkably wrong that it would make any sysadmins eyes pop out of his head. 1% is in fact extremely low in my opinion—my guess would be closer to 10-15% of sites have some glaring security hole. The only important thing is to not let it be your site.

Or a site holding data of yours, which is harder.

Re: 1% of CMS-Powered Sites Expose Their Database Passwords (2011)

#75
post #44

Earlier quoted context omitted.

Yes you can. Dotdeb's php-fpm.ini even includes this line by default: ; To configure the pools it is recommended to have one .conf file per ; pool in the following directory: include=/etc/php5/fpm/pool.d/*.conf Then you could configure ENV inside FPM pool using the env directive: env[DB_HOST] = localhost env[DB_USER] = foobar env[DB_PASSWORD] = foobar ...and use something like this in e.g. Wordpress config: define('D…

That's pretty handy. Didn't think about the phpinfo thing, actually, though in all fairness if they managed to upload any PHP files you're rather screwed. I think the way to be secure would be to not actually serve PHP files in the document root and instead have nginx proxy / directly to the FPM pool, and just alias your static files over, much as one would with Django.

If you wanna see php done right, forget about all the crap you have seen and take a look at symfony.com. It has great docs, that focus on teaching web development (not just a framework) and all these sysadmin best practices like how to set the permissions, etc. Trust me, I have used every popular framework (including Rails and Django), and Symfony2 has nothing to envy.

Re: 1% of CMS-Powered Sites Expose Their Database Passwords (2011)

#76
When I'm working with CodeIgniter (which ExpressionEngine is based off), I always rewrite access to subfolders of the project to the index.php file, because that's the only file that there needs to be access to for the site to function properly. This keeps anyone from accessing configuration (or any other) files.

  RewriteCond %{REQUEST_URI} ^somefolder.*
  RewriteRule ^(.*)$ /index.php?/$1 [L]

Re: 1% of CMS-Powered Sites Expose Their Database Passwords (2011)

#78
post #45

0. Put local config files outside of webroot or other publicly accessible directories, include programatically. 1. Disable swap/backup files in your editor (or write them to a different location)[1] 2. Git ignore or SVN ignore swap files and backup files 3. Configure your web server to not serve such files. Some combination of these should keep you safe. :) [1]: in vim: noswap nobackup nowritebackup or http://vim.wik…

4. Don't make live edits on your production server.

Re: 1% of CMS-Powered Sites Expose Their Database Passwords (2011)

#79
post #54

Earlier quoted context omitted.

That's not restricted to PHP, since it does not even depend on the language.

True, but other languages are not typically processed in the traditional mod_php way where urls are directly mapped to files in your static root, thus it's extremely rare to see e.g. python or ruby files served as static files.

I don't know what you mean. You just tell the web server what you want to do, and it will do it. Eg: "Process only files in this dir, and only accept requests to this kind of URL. And any request to that kind URL, pass it to this single php file".

Do software like XAMP have bad defaults and shouldn't be used for production out of the box? Maybe.

Has that helped a lot of people to get started, and make PHP the most popular server language for the web? Definitely.

Should we mock all php devs including experts, because of designers or ninja CEOs who tried/succeeded in editiing or making a website but made some mistakes in the process? The answer is still no.

Re: 1% of CMS-Powered Sites Expose Their Database Passwords (2011)

#80
> Thus, 230 / 216391 = 0.11% of all websites are vulnerable.

> Latest stats say that about 13.8% of the top 10,000 websites run CMSs. If we just focus on CMS-powered websites, then the percentage of vulnerable sites is much higher:

> Thus, 230 / (216391 * 0.138) = 0.77% of websites running a CMS are vulnerable.

I don't think those numbers mean what you think they mean.

13.8% out of 10,000 doesn't say much about the top 216,391. And perhaps 0 out of 230 of the vulnerable websites use CMS, however unlikely that is.

Post reply on HN