 | News Feed |
Sections
|
| feed this: |  |
Zend Developer Zone: PHP Built in Input filtering
by Chris Cornutt October 31, 2006 @ 12:51:00
The Zend Developer Zone has a new tutorial posted today by Pierre dealing with one of the things becoming (and should have always been) important to PHP developers - filtering input. Specifically, it deals with using the Filter extension built into PHP 5 to take care of anything malicious or incorrect that the user might throw at the application.
Security becomes the top priority (or activity) of many PHP developers. Its place and importance keeps growing in every single project, open source or commercial. Every conference provides a talk about security and you can read PHP security on the magazine cover pages.
The article is broken down into different sections, including:
- Don't trust external data
- Why Filter?
- How does it work?
- Prerequises/Installation/Considerations
And, of course, what would a tutorial be without some examples. Pierre shows a simple form that filters, a sanitizing form, and some more complex processing using a callback.
voice your opinion now!
tutorial input filtering extension php5 example tutorial input filtering extension php5 example
PHPBuilder.com: PHP Filtering with OWASP
by Chris Cornutt June 29, 2006 @ 06:15:37
On PHPBuilder.com today, there's a new tutorial that looks at a method to protect your PHP applications with the filters the Open Web Application Security Project provides.
OWASP (Open Web Application Security Project ) released a top ten list for web application security vulnerabilities in 2003 and 2004; you can find the latest information about their Top Ten Project here.
Most of the top ten vulnerabilities including (A1) Unvalidated Input, (A2) Broken Access Control, (A4) Cross Site Scripting (XSS) Flaws, and (A6) Injection Flaws, can be avoided by using these filters.
They walk through the installation before talking about the types of filters at your disposal - paranoid, SQL, system, HTML, int/float, UTF-8, and LDAP. The check() function looks at the inputted value to see if it passes the test (the other option the function takes).
They also give an example of combining filters as well, making more secure validation even easier.
voice your opinion now!
filtering security open web application project check types filtering security open web application project check types
PHPBuilder.com: Preventing spam when using PHP's mail function
by Chris Cornutt April 12, 2006 @ 15:47:45
Spam has grown into one of the worst problems on the internet today. It effects everyone, even those that guard their email addresses with their lives. Information spreads so fluidly in the bits and bytes of everyday communication, that it's almost inevitable for your address to get out. Once it's out, you'll know, getting emails from people you don't know offering things you don't want. One tool spammers can use, unfortunately, are the unsecured forms on your own site. Thankfully, there's articles like this one from PHPBuilder.com that can help you safeguard your site against these attacks.
Insecure PHP scripts have provided great opportunities for spammers to abuse other's resources to send out their spam. In particular, it's the mail() function that can be abused. I myself was the target a few months ago when I noticed spam being sent from an old form on my server that I'd forgotten about. This month's article looks at techniques that can be used to harden your mail form, and reduce the chances of it being misused.
They set up the simple example script and show you how to exploit it to follow the wishes of potential spammers. They offer a few suggestions on hardening the form - filtering for a correct email address, checking for "bad strings" in the contents of the form, and looking for a REQUEST_METHOD value in the $_SERVER array. The methods aren't fool-proof, but they can help to dramatically reduce your chances of being the source of a lot of people's annoyance.
voice your opinion now!
php mail prevent spam filtering bad strings request_method php mail prevent spam filtering bad strings request_method
DevShed: Enforcing Object Types in PHP - Filtering Input Objects in PHP 4
by Chris Cornutt February 16, 2006 @ 06:56:50
In this latest tutorial on DevShed today, they look at methods to enforce the types of objects in a PHP4 environment.
When you are writing an object-based web application in PHP, you want to prevent your classes from being convoluted with input objects of the incorrect type. These input objects can cause the application to throw a fatal error. In this article, you will learn how to enforce object types in PHP 4.
By the end of this series, hopefully you'll have a clear idea of how to force object types inside of your PHP application, in this way avoiding further problems related to the so-called code contamination.
They start off with the creation of an (X)HTML widgets class to render certain page elements. Then, they show you the creation of a class to render the page and display them in a full document. There are examples of what happens when type checking isn't done and how to enforce the types inside of your class.
voice your opinion now!
php enforcing object types filtering input HTML widgets php enforcing object types filtering input HTML widgets
Pierre's Blog: imagepng, take #2
by Chris Cornutt January 30, 2006 @ 07:37:31
Pierre has posted his second look at working with the imagepng function today over on his blog.
Bernhard Seefeld was testing the new compression option for imagepng and was wondering why there is still a relative big difference in image sizes.
In my first attempt to create smaller images, I only allowed to change the compression, it was not sufficient to get really lite pictures.
After a short look to the libpng codebase (and the horrible imagick doc), I added a last argument to imagepng, the filtering mode.
He includes code later in the post, showing how to use this filtering option to make even smaller images (an option included from PHP 5.1.3 and up).
voice your opinion now!
php imagepng compresssion light filtering option php imagepng compresssion light filtering option
|
Community Events
Don't see your event here? Let us know!
|