Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cleansing string / input in Coldfusion 9

I have been working with Coldfusion 9 lately (background in PHP primarily) and I am scratching my head trying to figure out how to 'clean/sanitize' input / string that is user submitted.

I want to make it HTMLSAFE, eliminate any javascript, or SQL query injection, the usual. I am hoping I've overlooked some kind of function that already comes with CF9.

Can someone point me in the proper direction?

like image 855
Jakub Avatar asked Dec 10 '22 11:12

Jakub


1 Answers

Well, for SQL injection, you want to use CFQUERYPARAM.

As for sanitizing the input for XSS and the like, you can use the ScriptProtect attribute in CFAPPLICATION, though I've heard that doesn't work flawlessly. You could look at Portcullis or similar 3rd-party CFCs for better script protection if you prefer.

like image 62
Kyle Humfeld Avatar answered Dec 29 '22 00:12

Kyle Humfeld