Cookie with whitespace in name as target
Anant Mudambi via mod-security-users <[email protected]> Mon, 28 Jul 2025 15:52:54 -0700
| Newsgroups | gmane.comp.apache.mod-security.user |
|---|---|
| Message-ID | <CALPdRR6PeAu1PBj6TLkwz9+msec4Gyvvr2pzsC5tiPzcC07v7Q@mail.gmail.com> |
--===============5117800469516516418== Content-Type: multipart/alternative; boundary="0000000000008e23c3063b052738" --0000000000008e23c3063b052738 Content-Type: text/plain; charset="UTF-8" Hello, I need to write a SecRule with a particular HTTP cookie as the target to be removed by a ctl:ruleRemoveTargetByTag. However, the cookie name has a whitespaces, so a rule like this throws an error: SecRule ... "id:1000, phase:2, pass, ctl:ruleRemoveTargetByTag=attack-rce;REQUEST_COOKIES:name with space ..." I've tried the below options but these didn't work either: SecRule ... "id:1000, phase:2, pass, ctl:ruleRemoveTargetByTag=attack-rce;REQUEST_COOKIES:'name with space' ..." SecRule ... "id:1000, phase:2, pass, ctl:ruleRemoveTargetByTag=attack-rce;REQUEST_COOKIES:name\ with\ space ..." Is it possible to do this? Thanks, Anant --0000000000008e23c3063b052738 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hello,<div>I need to write a SecRule with a particular HTT= P cookie as the target to be removed by a ctl:ruleRemoveTargetByTag. Howeve= r, the cookie name has a whitespaces, so a rule like this throws an error:<= /div><div><br></div><div>SecRule ... "id:1000, phase:2, pass, ctl:rule= RemoveTargetByTag=3Dattack-rce;REQUEST_COOKIES:name with space ..."</d= iv><div><br></div><div>I've tried the below options but these didn'= t work either:</div><div><br></div><div>SecRule ... "id:1000, phase:2,= pass, ctl:ruleRemoveTargetByTag=3Dattack-rce;REQUEST_COOKIES:'name wit= h space' ..."</div><div><br></div><div>SecRule ... "id:1000, = phase:2, pass, ctl:ruleRemoveTargetByTag=3Dattack-rce;REQUEST_COOKIES:name\= with\ space ..."</div><div><br></div><div>Is it possible to do this?<= /div><div>Thanks,</div><div>Anant</div></div> --0000000000008e23c3063b052738-- --===============5117800469516516418== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============5117800469516516418== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ mod-security-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mod-security-users Commercial ModSecurity Rules and Support from Trustwave's SpiderLabs: http://www.modsecurity.org/projects/commercial/rules/ http://www.modsecurity.org/projects/commercial/support/ --===============5117800469516516418==--