Forum Discussion
Yozzer
Mar 07, 2012Nimbostratus
XSS checks in irule
Hi
Can an irule check for special chars in a switch statement?
switch -glob [URI::decode [URI::query "?[HTTP::payload]" Param1]] {
"*<" {
set variable "x...
hooleylist
Mar 07, 2012Cirrostratus
Hi Yozzer,
Yes, you can check for potentially malicious metacharacters in a parameter value using an iRule. You might want to add a * to the end of the switch cases if you want to match the character at any position instead of just at the end of the parameter value. You'll also need to collect the full payload using HTTP::collect in HTTP_REQUEST if you want to check parameter values in POST payloads.
https://devcentral.f5.com/wiki/iRules.http__collect.ashx
Aaron
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