Forum Discussion
Sam_Hall
Nimbostratus
Dec 04, 2013Serving any iFiles: sanitising user input
Here I'm developing a global iRule to be applied to all my websites. During an outage, the iRule will serve up an outage page along with any additional resources that may have been included and store...
uni
Altocumulus
Dec 04, 2013Maybe check the file name represents an ifile early. Then, as long as your ifile names are "sane", you'll have no issues.
if { [lsearch -exact [ifile listall] "$qrystr"] }
...
- Sam_HallDec 04, 2013
Nimbostratus
Thanks, certainly looks safer and it's a cleaner option than using the catch command. I'm happy with this solution since we have full control over the ifile names, and I assume there's not much risk of TCL interpreting them as anything other than strings anyway. I'm relatively new to TCL and started to worry that TCL injection might be a possibility. A quick search turned up only a couple options for sanity checking, either using regex (which is apparently inefficient) or using scan (which seemed pretty limited).
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects