Yes, check out the encodeForHTML, and other functions starting with encodeFor. I wrote up a guide to XSS in ColdFusion here which goes into detail. Beyond that - script protect is a trivial protection, I wouldn't rely on it for doing too much - there are many many ways around it. The getSafeHTML function is also a good function, but it is best for cases when you know you have some legitimate HTML in the variable. If you shouldn't have HTML in a variable, (eg: name, phone number, etc) then use encodeForHTML instead. Finally, great job adding cfqueryparam, but that is not going to help you with XSS, but it will help you with SQL Injection.
... View more