I ran a pen-testing app and it found a ton of XSS errors, specfically, I'm guilty of echo'ing unverified data back to the browser through the querystring.
Specifically, running this puts javascript into my page. http://www.mywebsite.com/search.php?q=%00'" [ScRiPt]%20%0a%0d>alert(426177032569)%3B[/ScRiPt].
Thankfully, no where do I let users save data to a database and display back to other uesrs, so I THINK people would only be able to hack themselves with this problem, but I still want to fix it.
The recommendation is to do this:
echo htmlentities($_POST[‘input’], ENT_QUOTES, ‘UTF-8’);
But currently I need to get this patched up asap, then go fix on a case by case basis. I have a header file I include on every page on the site, I know it's bad form, but what could blow up if I did:
array_walk($_POST, 'htmlentities');
I'll need to do it for COOKIE and GET as well. I never use _REQUEST.
Thanks