rdivilbiss
Fri 23 November 2007, 03:26 am GMT +0100
Overall I think you have a nice class which could be especially useful for newer programmers. Your example pages however contain the often used flaw of setting a form action attribute (or a redirect) to $_SERVER['PHP_SELF'] which is a well documented XSS vulnerability. As your class is for implementing security, leaving XSS in the examples is probably not wise, considering the general audience.
Simply Google for XSS $_SERVER['PHP_SELF']
http://xforce.iss.net/xforce/xfdb/26518Similarly the lack of input validation in the examples and in the class could lead to various problems.
Also, I would remove the inline SQL in favor of parameterized SQL (for example:
http://www.expertsrt.net/main/components/com_mambowiki/index.php?title=PHP_MySql_Prepared_Statements_Library) and the more secure mysqli functions.
While you take precautions to prevent common SQL injection, you might want to consider some unexpected injections which can occur, such as those published here:
http://mordred.niama.net/blog/?p=121Again,pretty darn good start, but a few tweaks could lead to something bullet-proof and very useful to the newer developers. Possibly something like Reform.
http://www.owasp.org/index.php/Category:OWASP_Encoding_ProjectBest regards,
Rod