 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Reddit.com: How do YOU sanitize input?
by Chris Cornutt November 03, 2011 @ 11:04:02
On Reddit.com there's a recent post that asks the question How do YOU sanitize input in your PHP applications?
I am developing some software for my high school using HTML, CSS, MySQL, and most importantly PHP. [...] So I pose this question, what is YOUR favorite way to sanitize input for inserting, updating, or selecting from a database? Also, is there any way you prefer to verify that input is of a certain type, and only of that type ie, if you're expecting an int or a string, how would you make sure you are receiving one?
Answers on the post touch on things like:
voice your opinion now!
input sanitize database filter opinion
DreamInCode.com: Preventing PHP Mail(...) Header Injections
by Chris Cornutt April 22, 2011 @ 11:06:23
On the Dream In Code forums there's a recent post showing you how to prevent mail() header injections when taking user input, like from a form.
PHP's mail() function is a very useful and powerful function, even to the point that it is very easy to exploit. A way hackers exploit this function is a method called email header injection. [...] I'm sure most of you can already tell that's not going to be pretty since we didn't check the user input and so forth. PHP provides us with functions such as filter_var which will validate user input and either return false if the validation fails or return the filtered data.
He includes an example of using this filtering methods to check the user input for malicious information - validating that the "to" address is a valid email (FILTER_VALIDATE_EMAIL) and a sanitize() method that removes things like newlines, carriage returns and a few other characters.
voice your opinion now!
prevent mail header injection tutorial filtervar sanitize
Smashing Magazine: Keeping Web Users Safe By Sanitizing Input Data
by Chris Cornutt January 12, 2011 @ 12:49:13
On the Smashing Magazine site today Phillip Tellis has a new article advocating a common thread in PHP application development (really, any application development) - sanitizing user input to help keep you and your application's user safe.
In this article, I'm joined by my colleague Peter (evilops) Ellehauge in looking at input filtering in more depth while picking on a few real examples that we've seen around the web. As you'll see from the examples below, insufficient input validation can result in various kinds of code injection including XSS, and in some cases can be used to phish user credentials or spread malware.
Several examples are included show things like unfiltered use of PHP's superglobals, incorrectly quoted HTML attributes and some commonly overlooked areas like title tag injection and javascript analytics handling. They also talk about the different contexts the data might need to be filtered on - HTML, attributes, URLs, javascript, CSS and others.
voice your opinion now!
security sanitize data input tutorial output filter
Padraic Brady's Blog: HTML Sanitisation The Devil's In The Details (And The Vulnerabilities)
by Chris Cornutt August 10, 2010 @ 09:15:13
Padraic Brady has a new post to his blog today about something that has caused a lot of pain over the years for developers (not just PHP ones either) - HTML sanitization.
In this article, I take a look at some of the solutions PHP developers rely upon to perform HTML Sanitisation. Mostly because few others have done it or written about such solutions in any great detail (at least publicly). HTML Sanitisation has a very low profile in PHP. It's rarely mentioned, usually not understood all that well, and examining some of the solutions in this area with more deliberate attention is worth doing.
He introduces the subject, just to catch everyone up to speed, and describes some of the common problems developers have butted up against. He shows three different candidates for helping you filter the HTML input more effectively:
Each comes with a description of what the tool is and some of the pros and cons of using it.
voice your opinion now!
html sanitize filter tool suggestion
Genius Engineering Blog: Genius Open Source Libraries (Sanitize HTML Input)
by Chris Cornutt August 03, 2010 @ 11:56:32
On the Genius Engineering blog today they share a library they've created to help filter out possibly malicious content coming from the user - HTML content, valid or not.
Some time ago, Genius Engineering decided to unify the manner in which we encode values that contain user input. We previously depended upon the PHP built-in htmlentities() and some simple wrappers around it for our encoding needs, but this function alone can't safely sanitize tainted data in all contexts. [...] While there is plenty of information about these issues and what must be done to fix them, there is a distinct dearth of libraries in PHP to properly encode strings for all of the situations.
They include a few code examples of how to use their sanitizing library [tar.gz] to filter HTML overall, HTML attributes and filter strings for use in Javascript.
voice your opinion now!
sanitize opensource html input
|
Community Events
Don't see your event here? Let us know!
|