Hi Rob,
You have some good points there to be discussed for Joomla 1.5 with UTF-8 support and a great new J! framework.
But for Joomla 1.0 and joomla 3pd components, I'm sure (talked with other core and WG members):
magic_quotes_gpc = 1is way safer against SQL injections on Joomla 1.0 production servers (it even indeed protects from a lot of mistakes).
Thus developpers should indeed develop with setting 0 (so they see their mistakes) and test it also workd with setting 1 (so they check it works same and generates same outputs to database and html.
Talking about the J! 1.0 Framework: take a look at mosGetParam() : the most important thing it does is to check if magic_quotes_gpc is not set to 1, and in that case where it was OFF, to emulate that setting to be ON with adding slashes : the main use of mosGetParam() is that after using it you are sure to have an escaped string (obviously there are cases where you need to unescape them)
in includes/joomla.php:
Code:
// account for magic quotes setting
if (!get_magic_quotes_gpc()) {
$return = addslashes( $return );
}
Means the J! 1.0 Framework is escaping it allways (last time i checked 1.5 a few weeks back, it did same).
What magic_quotes_gpc=1 ensures is that variables not passed through mosGetParam() by ommission (all should be passed through there, right...) are also escaped, so that if they get used in SQL requests, they don't lead to SQL injection vulnerabilities.
You absolutely right that data-coherency needs to be kept, and double-escapings avoided in databases, to not break search functions. But well written code takes care of this whatever the magic_quotes are. Another very nice and clean implementation is the mosDbTable class. UTF-8 settings are also taken care correctly of in magic_quotes if in recent releases of php, php settings are correct. And these days, it's better to be up-to-date

rliskey,
LOL about your last post. 46 seems a little low, i would recommend a higher, rounded value between 0 and 1.

It's really 1 which is way safer for production sites with Joomla 1.0 extensions (and also for previous versions of joomla btw). i've a list of vulnerabilities and proofs of exploits with it at 0...but will not publish it here. You can take a look at the 1.0.11 changelog: you are protected from most if not all the "potential injection vulnerabilites" of 1.0.10 by the magic_quotes_gpc=1 setting.
Amy has a very good post. Would really be great to interlink or merge somehow (by making them both shorter LOL) the two excellent guides into a new security chapter for Joomla.
Well, ladies and gentlemen, 3:00 am here, no need for a whisky to get asleep

, magic quote stories are all it needs.
