Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | Canicalization Of User Input In PHP |
|---|---|
| Date: | Sun, 16 Jan 2005 22:40:11 -0800 |
http://www.owasp.org/software/labs/phpfilters.html // sanitize.inc.php // Sanitization functions for PHP // by: Gavin Zuchlinski, Jamie Pratt, Hokkaido // webpage: http://libox.net // Last modified: December 21, 2003
reset($_GET);
foreach($_GET as $key => $value){
// Transform to canonical form.
$ckey = my_utf8_decode(urldecode($key));
$cvalue = my_utf8_decode(urldecode($value));
if( $ckey != sanitize_paranoid_string($ckey) ||
$cvalue != sanitize_paranoid_string($cvalue) ){
header('location:www.somesight.net/index.php');
}
}I understand this example is simplistic, but is this a proper way to canonicalize the input values? Or am I missing something here?
Should I be looking at the following too?
$_SERVER['CONTENT_TYPE'] == 'application/x-www-form-urlencoded'
Any input would be appreciated.
thanks,
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | SQL injection, Francesco |
|---|---|
| Next by Date: | Re: Proposal to anti-phishing, Rogan Dawes |
| Previous by Thread: | Announcing: OWASP AppSec Europe 2005, April 9-10, Jeff Williams |
| Next by Thread: | Re: Canicalization Of User Input In PHP, Paul Johnston |
| Indexes: | [Date] [Thread] [Top] [All Lists] |