Removing special characters

Programming for Search Engines 101. An area for avid PHP and .NET developers to chat about Programming techniques and how to make better use of search engines.

Moderator: Moderators

Removing special characters

Postby suresh.j » Sat Aug 02, 2008 12:14 am

We have had our share of Cross Site Scripting(XSS) woes.
And I believe everyone in Techwyse knows how bad XSS can be.
Attackers usually inject special characters and getting rid of them is one way of defence.

Free Software foundation has a project for this purpose (Open Web Application Security Project)
There is at present an include file from the Project which can be used to "sanitize"
the content in dynamic pages.
Sanitizing works like this.
The functions can be called to remove special chars and render the predetermined character type(int, float, string, alphanumeric etc)

The file can be downloaded here


PHP guys, go santise your code. :)
OLD war HORSE
suresh.j
 
Posts: 12
Joined: Thu Oct 18, 2007 7:39 am
Location: Kochi, Kerala, India

Re: Removing special characters

Postby DJ » Mon Aug 04, 2008 4:46 pm

Thanks for this ! How can we apply what you have mentioned here to help out the problem?
The Deej
|
DJ
Site Admin
 
Posts: 1022
Joined: Thu May 04, 2006 4:47 pm

Re: Removing special characters

Postby suresh.j » Mon Aug 04, 2008 7:11 pm

Well DJ,
We need to get the PHP guys cracking and make sure they render content only through the functions mentioned above.
That would mean extraneous content would be "sanitized". The downside is that we would have to recode the whole website for the same.
OLD war HORSE
suresh.j
 
Posts: 12
Joined: Thu Oct 18, 2007 7:39 am
Location: Kochi, Kerala, India


Return to Programming

Who is online

Users browsing this forum: No registered users and 7 guests