Cross Site Scripting(XSS) (http://en.wikipedia.org/wiki/Cross-site_scripting) is a security hole that allows evil-doers to inject code into a web page.

http://www.acunetix.com/cross-site-scripting/scanner.htm - Acunetix Scanner - Free XSS scanner, does not allows saving of reports

http://kallahar.com/smallprojects/php_xss_filter_function. - RemoveXSS php function that seems to solve the problem.

Test Case

I downloaded the http://www.acunetix.com/cross-site-scripting/scanner.htm (Acunetix Scanner) and ran it on http://chesstst.eecs.berkeley.edu/pubs/search/ and it found plenty of problems.

I tried modifying php/pubs/pubs.php so that we called the PHP htmlentities() function:

$keywords         = htmlentities(getREQUESTValue('keywords'));

However, that did not work.

What did work was adding RemoveXSS() to php/include/utils.inc.php and then modified pubs.php:

$keywords         = RemoveXSS(getREQUESTValue('keywords'));
Rerunning the scanner showed no vulnerabilities.

Problem pages

Our biggest risks are from users who are not logged in, so we should concentrate on those pages first.

Any page that has a form (field, checkbox, radio button etc) or any page that processes the URL to do something is at risk.

Pages that were ok

Offhand, these pages are publicly accessible that have forms:

Pages that process URLS:

Java Server Pages (JSP) are now fixed

Possible Solutions

One idea would be to change getREQUESTValue() so that it uses RemoveXSS(). This would cause problems with any pages where we allow html tags such as