Archive of published posts on December, 2011

Back home

Cross-Site Scripting (XSS) and how to protect yourself against them

12/30/2011

xss tech radar articleTech Radar has put together a rather simple, but good starting point on what XSS is and how simple it is to avoid it. Worth a read!

Using a good framework such as Zend or Code Igniter helps  . These hardened PHP frameworks have developed security modules for some time and will be better than anything you can come up with in a day.

With Zend, make sure you grab everything using the getParam method in your controller like so;

$this->getRequest()->getParam('yourVar');

This will escape and remove most nasty information from user supplied data. But not everything. Make sure you sanitize the data based on what you expect to receive. If it’s a username, make sure that all non Alphanumeric are removed, same with the password. Phone numbers should only be numbers etc.

PHP’s Filter function is extremely powerful and should be in any good developers arsenal of well understood techniques.  Here is a list of available filters and sanitizers for you to play with;

Sanitize

FILTER_SANITIZE_EMAIL
FILTER_SANITIZE_ENCODED
FILTER_SANITIZE_MAGIC_QUOTES
FILTER_SANITIZE_NUMBER_FLOAT
FILTER_SANITIZE_NUMBER_INT
FILTER_SANITIZE_SPECIAL_CHARS
FILTER_SANITIZE_FULL_SPECIAL_CHARS
FILTER_SANITIZE_STRING
FILTER_SANITIZE_STRIPPED
FILTER_SANITIZE_URL
FILTER_UNSAFE_RAW

Validate

FILTER_VALIDATE_BOOLEAN
FILTER_VALIDATE_EMAIL
FILTER_VALIDATE_FLOAT
FILTER_VALIDATE_INT
FILTER_VALIDATE_IP
FILTER_VALIDATE_REGEXP
FILTER_VALIDATE_URL

If you are google-inept, here is the page on PHP filters

No Comments

A good wife

12/28/2011

Anyone who knows me knows that I’m an Apple Zealot. I have absolutely no shame in admitting that. I own a MacBook Pro, iMac 27, 2 iPhone 4′s (not 4s), iPod shuffle and an iPod Touch and I’m hanging out for the iPad 3. And now I have the greatest iBook – the wife knows me well!

I will report back once I’m through with thoughts.

No Comments

2012 – A Fresh Start

12/28/2011

So I’ve thought, “I’ve had this blog / site since 2006 and have done relatively little with it”. 2010 & 11 have been huge years for me. Starting with landing a developer role at an exciting Digital Agency in Melbourne which saw me develop my skills further as well as meet some amazing people who will be a part of my life for years to come. And I will see 2011 out starting the next chapter of my professional life working for the World Renowned Clemenger BBDO.

So this space has been seriously neglected for the last 12+ months and what better way to give it some love than to kill it.

I have decided to start this blog off fresh, to follow my journey at BBDO and share my knowledge, learnings of the Web and anything else that I feel is in need.

No Comments