This is a short and informative video that shows just how easy it is to take advantage of a web application where security was not given much thought:
If you're writing web apps and not sanitizing your input, then this may have happened to you already. You're logging all accesses, right? Right?
If you're writing web apps and not sanitizing your input, then this may have happened to you already. You're logging all accesses, right? Right?
(no subject)
Date: 2007-06-14 07:56 pm (UTC)(no subject)
Date: 2007-06-14 08:29 pm (UTC)I see this all too often, where someone knows only what they were taught in class and can't (or doesn't want to) learn anything else on their own. It really is a case of when all you have is a hammer, everything else looks like a nail.
(no subject)
Date: 2007-06-14 08:25 pm (UTC)(no subject)
Date: 2007-06-14 08:34 pm (UTC)(no subject)
Date: 2007-06-14 10:24 pm (UTC)I think the latest 2600 talked about something similar with bad web application security.
(no subject)
Date: 2007-06-14 10:25 pm (UTC)Me, personally, I refused to start writing my personal furry website with PHP & MySQL until I knew how to secure it... :-P
(no subject)
Date: 2007-06-14 11:35 pm (UTC)- Database stuff: Sanitize it. mysql_escape_string() is your friend. ADODB will do this if you make use of query parameters. Oracle has binding functions which are all sorts of awesome.
- File/directory names: whitelist them. Set up a regex so that any characters outside of those you choose to allow will be turned into an underscore. ("[^a-zA-z0-9]") would be a good start. This also protects against directory traversal attacks.
- Functions. Document them religiously with PHPDoc or a similar documenting scheme. Make it clear what the inputs and outputs are, and if there are any pre/post-conditions for the function.
The problem is that people either don't know, or are just plain lazy. Our industry is expanding fast enough that there is plenty of demand, and sometimes higherups just don't know how to evaluate what programmers do.
(no subject)
Date: 2007-06-15 12:43 am (UTC)(no subject)
Date: 2007-06-15 12:52 am (UTC)The problem with Magic Quotes is that it does things half-assed. It escapes, but does not provide a mechanism for unescaping content. Ever see a site that has all quotes proceeded by backslashes? That's where Magic Quotes has run amuck.
Did I mention that it not being enabled in all PHP installations only complicates the problem? It's so bad that in Drupal, they wrot ethe fix_gpc_magic() function to specifically undo what Magic Quotes does.
(no subject)
Date: 2007-06-15 01:46 am (UTC)I haven't looked into mysql_escape_string() yet... thanks for pointing it out! I'll certainly save a copy of your post!
P.S. I threw out my old PHP books 2-3 years ago... bought a new one last week. Hopefully it will cover the security holes the old ones left out.
(no subject)
Date: 2007-06-15 12:14 pm (UTC)(no subject)
Date: 2007-06-15 01:15 pm (UTC)Unfortunately, there's more overhead to that. However, ADODB's Execute() function actually lets you use a similar syntax for such statements and specify the values as separate parameters. And ADODB is platform independent. :-)
(no subject)
Date: 2007-06-15 01:24 pm (UTC)(no subject)
Date: 2007-06-15 01:26 pm (UTC)Hmm, I'll look into that then. With the volume we have here, any caching will help us!
(no subject)
Date: 2007-06-15 02:19 pm (UTC)(no subject)
Date: 2007-06-15 02:23 pm (UTC)For large scripts, I'll bet I can do a lot with a static variable inside a function serving as a prepared statement cache.
(no subject)
Date: 2007-06-15 02:41 pm (UTC)(no subject)
Date: 2007-06-15 02:51 pm (UTC)Multi-threading in PHP? Haha, what's that? :-)
(no subject)
Date: 2007-06-14 10:26 pm (UTC)(no subject)
Date: 2007-06-15 05:26 am (UTC)I'm actually more concerned about XSS attacks because they're so hard to filter for on a site that allows HTML in user data...
(no subject)
Date: 2007-06-15 06:11 am (UTC)(no subject)
Date: 2007-06-18 05:39 pm (UTC)1) Just the script kiddies.
2) Since the author says it was a security audit that he was hired/authorized to conduct, I suspect that the issue was fixed before the video was published.