Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Arantor
7156
No... I'm not vastly interested in developing or supporting MU myself, hence the 'evil glare' comment. But by adapting the design somewhat from SMF's database structure, MU becomes far less of the evil nightmare it is to implement in SMF.

The reason it's such a butt-ache is that the members table contains partial avatar information (the rest is in the attachments table, which you can't really share), and membergroup associations (inlined into the row, so all your multi-forums need to share membergroups by design).
7157
Features: Forward thinking / Re: Removing deprecated code
« on June 21st, 2011, 09:35 AM »
For liking the fact that we're pushing more recent versions.
7158
Off-topic / Re: htmlspecialchars while inserting into DB
« on June 21st, 2011, 09:35 AM »
Quote
I say this even though I think SMF does do it for posts at least, but there are many mistakes I either made or didn't fix when I wrote SMF.
SMF and Wedge do it for almost everything that moves into the database, except in a few specific places where the ability to use raw HTML is desirable and only the admin can set that up (board descriptions, censored words - which is why in 2.0 RC4 it became admin only as opposed to being moderate_forum before that).

That is to say, usernames, topic subjects and the like are htmlspecialchars'd with ENT_QUOTES if I remember right, while messages are htmlspecialchars'd, and pushed through preparsecode which fixes up certain bbcode requirements (neuters nobbc contents, enforces the html bbcode is only accessible by admin, attempts to fix/validate certain types of bbcode interaction, e.g. table->tr->td).

I wonder if preparsecode's changing everything into br tags is a holdover from YaBB where everything was in flat files. (I don't know how it was stored, but it seems feasible to me)
Quote
Ultimately, I think the original text should be stored, but it becomes an upgrade problem (and who wants the upgrade on large forums to change all the text?)
That's one of the things we can do something about. We've expressly set ourselves on the path of having an importer rather than just 'upgrading' the existing tables - aside from the fact it lets people run them both side by side to experiment, it also means we can do manipulations along the way like fix any of these things we decide to resolve.
Quote
No reason not to sanitize both ends, IMHO.
Depends what you mean by sanitise. htmlspecialchars both ends strikes me as a bad idea, for example.
Quote
I like the methodology I tried to push in SMF: if it's broken, fix it
Well, the methodology I was referring to was that all mods using the database should use $smcFunc's functions, and should be using the proper parameterisation, or the proper insert method made available that deals with escaping etc for you.

And yes, if it's broken, it should be fixed. That's one of the things that rattled me so much about 2.0 final: an astounding number of bugs were just deferred. While I as much as anyone accept that software is released with bugs, there's a difference between releasing with known bugs and releasing with unknown bugs, as well as releasing with architectural bugs that will need a complete rewrite of components to fix, and it irked me immensely that so many known bugs that weren't major but weren't that hard to fix (in more than one case a fix was provided and shown to work), and were still deferred through some "well, it might cause regressions" mantra.
Quote
Of people who take it, I think <10% pick a or b.  90% pick route c.  It baffles me.
We use jQuery in Wedge. Not just because it means we get to minimise the code to be sent to users (since the admin can pick a CDN copy of jQuery), but the time we spent writing JS is shorter, and I suspect less time is also spent in debugging. Plus a lot of users do add stuff that makes use of jQuery, so having it in the core means plugins won't try each adding it and falling over each other.
7159
Off-topic / Re: Post-XSS scenarios and database driven sessions
« on June 21st, 2011, 02:32 AM »
Ugh, I know that feeling, hope you get to sleep OK soon
7160
Off-topic / Re: Post-XSS scenarios and database driven sessions
« on June 21st, 2011, 02:20 AM »
htmlspecialchars is a tool. It protects against one angle of attack. There are others.
7161
Off-topic / Re: Post-XSS scenarios and database driven sessions
« on June 21st, 2011, 02:12 AM »
Quote
Ah so that's what the salt is for, didn't know that.
That's about the only thing it is actually used for.
Quote
Well that's true, and it's quite saddening knowing that there are ways to get around all this.
Every system has its chinks. Short session length, using tokens, time state etc. are all things your banking site should be doing out of the box anyway.

Really, even sticking it all over SSL isn't foolproof, it just helps protect against another slew of issues.
7162
Off-topic / Re: Post-XSS scenarios and database driven sessions
« on June 21st, 2011, 02:02 AM »
Let's be honest for a moment: the entire nature of cookies is a workaround for the fact that you want to represent some semblance of state over a protocol designed to be stateless.
Quote
Oh, and in SMF's case, if an user got somebody's cookie he or she can basically access his or her account since passwords can be sent pre-SHA1'd.
The password has been hashed with the passwordSalt (password_salt) value, which is known only in the database, and it *must* be SHA1 hashed with that salt on receipt, it won't ever be accepted by the cookie authentication code if not, and that salt is never shared.

They have access to the 'softer' stuff. They won't be able to go into the admin panel (assuming admin security has not been disabled), or change account options for other users (also uses admin security check), or change account details for the user they're masquerading as (since it requires their current password to do so)
7163
Off-topic / Re: Post-XSS scenarios and database driven sessions
« on June 21st, 2011, 01:42 AM »
Quote
That's it? Well that's depressing...
*shrug* There is also the fact that in a fair percentage of cases (and if you're tuning your server, more than a fair percentage), the session table will also reside in memory rather than forcing disk I/O. Any table that's hit every single request has to be worth this...
Quote
Would PHPSESSID count? I wouldn't think so.
Yup. Don't know if you're thinking of SMF/Wedge or something else, but if you don't have the cookie, you're relying on the session being passed through the URL, which means it's scrape-able from there. Worse still, depending on how that session is validated, there's also a potential vulnerability from fixation where the provided one is treated as expressly valid and ends up overriding a genuine session id, so an attacker forces a user to have a predictable session id... which isn't very good.
7164
Off-topic / Re: htmlspecialchars while inserting into DB
« on June 21st, 2011, 01:32 AM »
That's something that bothers me about WP: some people that know what they're doing use PDO etc, others use WP's own functions, and somewhere in the middle, shit happens.

At least with SMF, mods are vetted and generally have had oddities weeded out - so SMF, and Wedge, sort out magic quote once and for all, right up front, and mods are then allowed to use that content - plus they're all supposed to use the proper methodology for inserting data into the DB and querying it using the abstracted methods.

Unless your name is <censored> and you can 'legitimately ignore the rules' because you're one of the people who enforces them, and it worked 'OK' for the more wild and untamed SMF 1.1 so just re-wrapping it in the 2.0 style call is acceptable >:(
7165
Off-topic / Re: Post-XSS scenarios and database driven sessions
« on June 21st, 2011, 01:20 AM »
Last question first. Database driven sessions help in shared host cases. By having them in your database tables, as opposed to a system-wide temporary folder, the odds of session poisoning or simple overwriting by accident are basically nil.

Post-XSS scenarios... hmm. Cookie stealing is the main one in our case, especially when you start combining it with CSRF (doesn't have to be explicitly cross site!)

If you can steal the cookie, you can theoretically regenerate it on a separate machine and spoof the session - though you have to generate it as a cookie, you can't just plug it into the URL and expect it to work (if it did, you'd have a session fixation issue). The solution for that is to use HTTP-only cookies, cookies that indicate they are only for the current browser context and explicitly not exposed to the script context.

That won't prevent you if you have URLs with the session in them, which can be scraped and are accessible to the current scripting context.
7166
Off-topic / Re: htmlspecialchars while inserting into DB
« on June 21st, 2011, 12:39 AM »
There is a second reason why you might/would htmlspecialchars content on output: simply that you may not always be able to guarantee the sanity of runtime variables etc. in the current context.

The thing you might need to watch out for is double-calling, no need to call htmlspecialchars on outputs where it has already been run before...
7167
Off-topic / Re: htmlspecialchars while inserting into DB
« on June 21st, 2011, 12:05 AM »
It depends what you're trying to protect against.

mysql_real_escape_string going in will protect you against SQL injections, and in SMF/Wedge's case, the parameterisation is sufficient combined with the aforementioned to effectively neutralise this problem.

htmlspecialchars isn't going to protect you against SQL injections but it's there for XSS and anti-malicious scripting purposes. We cannot ever assume what the user is giving us is clean, so we expressly neuter it before letting it anywhere near the DB.

You'll note that in SMF/Wedge's case, anything destined to be used in the html bbcode is reformatted slightly to de-neuter it.

SMF (and Wedge)'s specific brand of content encoding going into the DB, where bbcode is concerned at least, is slightly odd, and one day I'll figure out exactly why it was done the way it was (remove newlines, expressly inject br tags into the stored content, after htmlspecialchars has been run)

@CJ Jackson: I'd rather not be trying to sanitise on output, I'd rather sanitise it when capturing it so that if something screwball tries to dump the contents of the DB, it's still going to be safe because there isn't anything dirty in the DB.

SMF/Wedge is pretty meticulous inside about stuff going into the DB being clean, shame not all mods are quite so clean about it. And if you're getting slashes from the DB, there's something more broken about content going in, in the first place.
7168
The Pub / Re: Interesting site
« on June 20th, 2011, 07:27 PM »
As for me, I've been working on the new package manager and one component I want to introduce but haven't been able to decide exactly how I want it to work.
7169
Off-topic / Re: Introduction
« on June 20th, 2011, 07:17 PM »
It wasn't meant as a command, simply a statement, in response to the question asked - the signature is hidden until you've made more posts.
7170
Other software / Re: 2.0 in download area
« on June 20th, 2011, 11:35 AM »
Also, it's starting to be noticed: http://www.simplemachines.org/community/index.php?topic=438826.0

Yes, all software invariably ships with bugs, but it still feels like a PR move to me rather than one done for the right reasons.