Skip to content
This repository was archived by the owner on May 14, 2020. It is now read-only.

Commit 696167e

Browse files
committed
Merge remote-tracking branch 'upstream/v3.1/dev' into v3.1/dev-contributing
2 parents 1bdb2f2 + 29c3e9a commit 696167e

18 files changed

+136
-134
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ branches:
99
only:
1010
- v3.0/dev
1111
- v3.0/master
12+
- v3.1/dev

rules/REQUEST-901-INITIALIZATION.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ SecAction \
232232
# have already been initiated.
233233
#
234234

235-
SecRule REQUEST_HEADERS:User-Agent "^(.*)$" \
235+
SecRule REQUEST_HEADERS:User-Agent "@rx ^(.*)$" \
236236
"id:901318, \
237237
phase:1, \
238238
t:none,t:sha1,t:hexEncode, \

rules/REQUEST-903.9001-DRUPAL-EXCLUSION-RULES.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ SecRule REQUEST_METHOD "@streq POST" \
264264
chain"
265265
SecRule REQUEST_FILENAME "@rx /admin/content/assets/add/[a-z]+$" \
266266
"chain"
267-
SecRule REQUEST_COOKIES:/S?SESS[a-f0-9]+/ "^[a-zA-Z0-9_-]+" \
267+
SecRule REQUEST_COOKIES:/S?SESS[a-f0-9]+/ "@rx ^[a-zA-Z0-9_-]+" \
268268
"ctl:requestBodyAccess=Off"
269269

270270
SecRule REQUEST_METHOD "@streq POST" \
@@ -299,7 +299,7 @@ SecRule REQUEST_METHOD "@streq POST" \
299299
"chain"
300300
SecRule REQUEST_HEADERS:Content-Type "@streq multipart/form-data" \
301301
"chain"
302-
SecRule REQUEST_COOKIES:/S?SESS[a-f0-9]+/ "^@rx [a-zA-Z0-9_-]+" \
302+
SecRule REQUEST_COOKIES:/S?SESS[a-f0-9]+/ "@rx ^[a-zA-Z0-9_-]+" \
303303
"ctl:requestBodyAccess=Off"
304304

305305

rules/REQUEST-903.9002-WORDPRESS-EXCLUSION-RULES.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ SecRule REQUEST_FILENAME "@endsWith /wp-admin/admin-ajax.php" \
410410
nolog,\
411411
pass,\
412412
chain"
413-
SecRule ARGS:action "^(save-widget|update-widget)$" \
413+
SecRule ARGS:action "@rx ^(save-widget|update-widget)$" \
414414
"t:none,\
415415
chain"
416416
SecRule &ARGS:action "@eq 1" \

rules/REQUEST-905-COMMON-EXCEPTIONS.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ SecRule REQUEST_LINE "@streq GET /" \
3232
#
3333
# Exception for Apache internal dummy connection
3434
#
35-
SecRule REQUEST_LINE "^(GET /|OPTIONS \*) HTTP/[12]\.[01]$" \
35+
SecRule REQUEST_LINE "@rx ^(GET /|OPTIONS \*) HTTP/[12]\.[01]$" \
3636
"phase:1,\
3737
id:905110,\
3838
t:none,\
@@ -46,7 +46,7 @@ SecRule REQUEST_LINE "^(GET /|OPTIONS \*) HTTP/[12]\.[01]$" \
4646
SecRule REMOTE_ADDR "@ipMatch 127.0.0.1,::1" \
4747
"t:none,\
4848
chain"
49-
SecRule REQUEST_HEADERS:User-Agent "^.*\(internal dummy connection\)$" \
49+
SecRule REQUEST_HEADERS:User-Agent "@rx ^.*\(internal dummy connection\)$" \
5050
"t:none,\
5151
ctl:ruleEngine=Off,\
5252
ctl:auditEngine=Off"

rules/REQUEST-910-IP-REPUTATION.conf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ SecRule TX:DO_REPUT_BLOCK "@eq 1" \
5757
#
5858
# This rule does a GeoIP resolution on the client IP address.
5959
#
60-
SecRule TX:HIGH_RISK_COUNTRY_CODES "!^$" \
60+
SecRule TX:HIGH_RISK_COUNTRY_CODES "!@rx ^$" \
6161
"msg:'Client IP is from a HIGH Risk Country Location.',\
6262
severity:'CRITICAL',\
6363
id:910100,\
@@ -162,7 +162,7 @@ SecRule TX:REAL_IP "@rbl dnsbl.httpbl.org" \
162162
tag:'attack-reputation-ip',\
163163
chain,\
164164
setvar:tx.httpbl_msg=%{tx.0}"
165-
SecRule TX:httpbl_msg "RBL lookup of .*?.dnsbl.httpbl.org succeeded at TX:checkip. (.*?): .*" \
165+
SecRule TX:httpbl_msg "@rx RBL lookup of .*?.dnsbl.httpbl.org succeeded at TX:checkip. (.*?): .*" \
166166
"t:none,\
167167
capture,\
168168
setvar:tx.httpbl_msg=%{tx.1}"
@@ -181,7 +181,7 @@ SecRule TX:block_search_ip "@eq 1" \
181181
tag:'attack-reputation-ip',\
182182
chain,\
183183
skipAfter:END_RBL_CHECK"
184-
SecRule TX:httpbl_msg "Search Engine" \
184+
SecRule TX:httpbl_msg "@rx Search Engine" \
185185
"setvar:'tx.msg=%{rule.msg}',\
186186
setvar:tx.anomaly_score=+%{tx.critical_anomaly_score},\
187187
setvar:tx.%{rule.id}-AUTOMATION/MALICIOUS-%{matched_var_name}=%{matched_var},\
@@ -204,7 +204,7 @@ SecRule TX:block_spammer_ip "@eq 1" \
204204
tag:'attack-reputation-ip',\
205205
chain,\
206206
skipAfter:END_RBL_CHECK"
207-
SecRule TX:httpbl_msg "(?i)^.*? spammer .*?$" \
207+
SecRule TX:httpbl_msg "@rx (?i)^.*? spammer .*?$" \
208208
"setvar:'tx.msg=%{rule.msg}',\
209209
setvar:tx.anomaly_score=+%{tx.critical_anomaly_score},\
210210
setvar:tx.%{rule.id}-AUTOMATION/MALICIOUS-%{matched_var_name}=%{matched_var},\
@@ -227,7 +227,7 @@ SecRule TX:block_suspicious_ip "@eq 1" \
227227
tag:'attack-reputation-ip',\
228228
chain,\
229229
skipAfter:END_RBL_CHECK"
230-
SecRule TX:httpbl_msg "(?i)^.*? suspicious .*?$" \
230+
SecRule TX:httpbl_msg "@rx (?i)^.*? suspicious .*?$" \
231231
"setvar:'tx.msg=%{rule.msg}',\
232232
setvar:tx.anomaly_score=+%{tx.critical_anomaly_score},\
233233
setvar:tx.%{rule.id}-AUTOMATION/MALICIOUS-%{matched_var_name}=%{matched_var},\
@@ -250,7 +250,7 @@ SecRule TX:block_harvester_ip "@eq 1" \
250250
tag:'attack-reputation-ip',\
251251
chain,\
252252
skipAfter:END_RBL_CHECK"
253-
SecRule TX:httpbl_msg "(?i)^.*? harvester .*?$" \
253+
SecRule TX:httpbl_msg "@rx (?i)^.*? harvester .*?$" \
254254
"setvar:'tx.msg=%{rule.msg}',\
255255
setvar:tx.anomaly_score=+%{tx.critical_anomaly_score},\
256256
setvar:tx.%{rule.id}-AUTOMATION/MALICIOUS-%{matched_var_name}=%{matched_var},\

rules/REQUEST-912-DOS-PROTECTION.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ SecRule IP:DOS_BLOCK "@eq 1" \
158158
#
159159
# DOS Counter: Count the number of requests to non-static resources
160160
#
161-
SecRule REQUEST_BASENAME ".*?(\.[a-z0-9]{1,10})?$" \
161+
SecRule REQUEST_BASENAME "@rx .*?(\.[a-z0-9]{1,10})?$" \
162162
"phase:5,\
163163
id:912150,\
164164
t:none,\

rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ SecRule TX:PARANOIA_LEVEL "@lt 1" "phase:2,id:920012,nolog,pass,skipAfter:END-RE
4444
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.2.1
4545
# http://capec.mitre.org/data/definitions/272.html
4646
#
47-
SecRule REQUEST_LINE "!^(?i:(?:[a-z]{3,10}\s+(?:\w{3,7}?://[\w\-\./]*(?::\d+)?)?/[^?#]*(?:\?[^#\s]*)?(?:#[\S]*)?|connect (?:\d{1,3}\.){3}\d{1,3}\.?(?::\d+)?|options \*)\s+[\w\./]+|get /[^?#]*(?:\?[^#\s]*)?(?:#[\S]*)?)$" \
47+
SecRule REQUEST_LINE "!@rx ^(?i:(?:[a-z]{3,10}\s+(?:\w{3,7}?://[\w\-\./]*(?::\d+)?)?/[^?#]*(?:\?[^#\s]*)?(?:#[\S]*)?|connect (?:\d{1,3}\.){3}\d{1,3}\.?(?::\d+)?|options \*)\s+[\w\./]+|get /[^?#]*(?:\?[^#\s]*)?(?:#[\S]*)?)$" \
4848
"msg:'Invalid HTTP Request Line',\
4949
severity:'WARNING',\
5050
id:920100,\
@@ -95,7 +95,7 @@ SecRule REQUEST_LINE "!^(?i:(?:[a-z]{3,10}\s+(?:\w{3,7}?://[\w\-\./]*(?::\d+)?)?
9595
# https://www.owasp.org/index.php/ModSecurity_CRS_RuleID-960000
9696
# http://www.ietf.org/rfc/rfc2183.txt
9797
#
98-
SecRule FILES_NAMES|FILES "(?<!&(?:[aAoOuUyY]uml)|&(?:[aAeEiIoOuU]circ)|&(?:[eEiIoOuUyY]acute)|&(?:[aAeEiIoOuU]grave)|&(?:[cC]cedil)|&(?:[aAnNoO]tilde)|&(?:amp)|&(?:apos));|['\"=]" \
98+
SecRule FILES_NAMES|FILES "@rx (?<!&(?:[aAoOuUyY]uml)|&(?:[aAeEiIoOuU]circ)|&(?:[eEiIoOuUyY]acute)|&(?:[aAeEiIoOuU]grave)|&(?:[cC]cedil)|&(?:[aAnNoO]tilde)|&(?:amp)|&(?:apos));|['\"=]" \
9999
"msg:'Attempted multipart/form-data bypass',\
100100
severity:'CRITICAL',\
101101
id:920120,\
@@ -204,7 +204,7 @@ SecRule MULTIPART_STRICT_ERROR "!@eq 0" \
204204
# -=[ References ]=-
205205
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
206206
#
207-
SecRule REQUEST_HEADERS:Content-Length "!^\d+$" \
207+
SecRule REQUEST_HEADERS:Content-Length "!@rx ^\d+$" \
208208
"msg:'Content-Length HTTP header is not numeric.',\
209209
severity:'CRITICAL',\
210210
id:920160,\
@@ -240,7 +240,7 @@ SecRule REQUEST_HEADERS:Content-Length "!^\d+$" \
240240
# -=[ References ]=-
241241
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3
242242
#
243-
SecRule REQUEST_METHOD "^(?:GET|HEAD)$" \
243+
SecRule REQUEST_METHOD "@rx ^(?:GET|HEAD)$" \
244244
"msg:'GET or HEAD Request with Body Content.',\
245245
severity:'CRITICAL',\
246246
id:920170,\
@@ -257,7 +257,7 @@ SecRule REQUEST_METHOD "^(?:GET|HEAD)$" \
257257
tag:'OWASP_CRS/PROTOCOL_VIOLATION/INVALID_HREQ',\
258258
tag:'CAPEC-272',\
259259
chain"
260-
SecRule REQUEST_HEADERS:Content-Length "!^0?$" \
260+
SecRule REQUEST_HEADERS:Content-Length "!@rx ^0?$" \
261261
"t:none,\
262262
setvar:'tx.msg=%{rule.msg}',\
263263
setvar:tx.anomaly_score=+%{tx.critical_anomaly_score},\
@@ -274,7 +274,7 @@ SecRule REQUEST_METHOD "^(?:GET|HEAD)$" \
274274
# -=[ References ]=-
275275
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5
276276
#
277-
SecRule REQUEST_METHOD "^POST$" \
277+
SecRule REQUEST_METHOD "@rx ^POST$" \
278278
"msg:'POST request missing Content-Length Header.',\
279279
severity:'WARNING',\
280280
id:920180,\
@@ -320,7 +320,7 @@ SecRule REQUEST_METHOD "^POST$" \
320320
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
321321
# http://seclists.org/fulldisclosure/2011/Aug/175
322322
#
323-
SecRule REQUEST_HEADERS:Range|REQUEST_HEADERS:Request-Range "(\d+)\-(\d+)\," \
323+
SecRule REQUEST_HEADERS:Range|REQUEST_HEADERS:Request-Range "@rx (\d+)\-(\d+)\," \
324324
"capture,\
325325
phase:2,\
326326
rev:'2',\
@@ -354,7 +354,7 @@ SecRule REQUEST_HEADERS:Range|REQUEST_HEADERS:Request-Range "(\d+)\-(\d+)\," \
354354
# -=[ References ]=-
355355
# http://www.bad-behavior.ioerror.us/documentation/how-it-works/
356356
#
357-
SecRule REQUEST_HEADERS:Connection "\b(keep-alive|close),\s?(keep-alive|close)\b" \
357+
SecRule REQUEST_HEADERS:Connection "@rx \b(keep-alive|close),\s?(keep-alive|close)\b" \
358358
"phase:2,\
359359
rev:'2',\
360360
ver:'OWASP_CRS/3.0.0',\
@@ -384,7 +384,7 @@ SecRule REQUEST_HEADERS:Connection "\b(keep-alive|close),\s?(keep-alive|close)\b
384384
# -=[ References ]=-
385385
# http://www.ietf.org/rfc/rfc1738.txt
386386
#
387-
SecRule REQUEST_URI "\%((?!$|\W)|[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})" \
387+
SecRule REQUEST_URI "@rx \%((?!$|\W)|[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})" \
388388
"phase:2,\
389389
rev:'2',\
390390
ver:'OWASP_CRS/3.0.0',\
@@ -404,7 +404,7 @@ SecRule REQUEST_URI "\%((?!$|\W)|[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})" \
404404
setvar:tx.anomaly_score=+%{tx.warning_anomaly_score},\
405405
setvar:tx.%{rule.id}-OWASP_CRS/PROTOCOL_VIOLATION/EVASION-%{matched_var_name}=%{matched_var}"
406406

407-
SecRule REQUEST_HEADERS:Content-Type "^(application\/x-www-form-urlencoded|text\/xml)(?:;(?:\s?charset\s?=\s?[\w\d\-]{1,18})?)??$" \
407+
SecRule REQUEST_HEADERS:Content-Type "@rx ^(application\/x-www-form-urlencoded|text\/xml)(?:;(?:\s?charset\s?=\s?[\w\d\-]{1,18})?)??$" \
408408
"phase:2,\
409409
rev:'2',\
410410
ver:'OWASP_CRS/3.0.0',\
@@ -419,7 +419,8 @@ SecRule REQUEST_HEADERS:Content-Type "^(application\/x-www-form-urlencoded|text\
419419
tag:'OWASP_CRS/PROTOCOL_VIOLATION/EVASION',\
420420
severity:'WARNING',\
421421
chain"
422-
SecRule REQUEST_BODY|XML:/* "\%((?!$|\W)|[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})" "chain"
422+
SecRule REQUEST_BODY|XML:/* "@rx \%((?!$|\W)|[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})" \
423+
"chain"
423424
SecRule REQUEST_BODY|XML:/* "@validateUrlEncoding" \
424425
"setvar:'tx.msg=%{rule.msg}',\
425426
setvar:tx.anomaly_score=+%{tx.warning_anomaly_score},\
@@ -473,7 +474,7 @@ SecRule TX:CRS_VALIDATE_UTF8_ENCODING "@eq 1" \
473474
# https://www.checkpoint.com/defense/advisories/public/2007/cpai-2007-201.html
474475
# https://github.com/SpiderLabs/owasp-modsecurity-crs/issues/719
475476
#
476-
SecRule REQUEST_URI|REQUEST_BODY "\%u[fF]{2}[0-9a-fA-F]{2}" \
477+
SecRule REQUEST_URI|REQUEST_BODY "@rx \%u[fF]{2}[0-9a-fA-F]{2}" \
477478
"msg:'Unicode Full/Half Width Abuse Attack Attempt',\
478479
id:920260,\
479480
severity:'WARNING',\
@@ -582,7 +583,7 @@ SecRule &REQUEST_HEADERS:Host "@eq 0" \
582583
skipAfter:END_HOST_CHECK"
583584

584585

585-
SecRule REQUEST_HEADERS:Host "^$" \
586+
SecRule REQUEST_HEADERS:Host "@rx ^$" \
586587
"msg:'Empty Host Header',\
587588
severity:'WARNING',\
588589
phase:2,\
@@ -623,7 +624,7 @@ SecMarker END_HOST_CHECK
623624
# https://github.com/SpiderLabs/owasp-modsecurity-crs/issues/366
624625
#
625626

626-
SecRule REQUEST_HEADERS:Accept "^$" \
627+
SecRule REQUEST_HEADERS:Accept "@rx ^$" \
627628
"msg:'Request Has an Empty Accept Header',\
628629
chain,\
629630
phase:2,\
@@ -638,7 +639,7 @@ SecRule REQUEST_HEADERS:Accept "^$" \
638639
tag:'platform-multi',\
639640
tag:'attack-protocol',\
640641
tag:'OWASP_CRS/PROTOCOL_VIOLATION/MISSING_HEADER_ACCEPT'"
641-
SecRule REQUEST_METHOD "!^OPTIONS$" \
642+
SecRule REQUEST_METHOD "!@rx ^OPTIONS$" \
642643
"chain"
643644
SecRule REQUEST_HEADERS:User-Agent "!@pm AppleWebKit Android Business Enterprise Entreprise" \
644645
"t:none,\
@@ -649,7 +650,7 @@ SecRule REQUEST_HEADERS:Accept "^$" \
649650
#
650651
# This rule is a sibling of rule 920310.
651652
#
652-
SecRule REQUEST_HEADERS:Accept "^$" \
653+
SecRule REQUEST_HEADERS:Accept "@rx ^$" \
653654
"msg:'Request Has an Empty Accept Header',\
654655
chain,\
655656
phase:2,\
@@ -664,7 +665,7 @@ SecRule REQUEST_HEADERS:Accept "^$" \
664665
tag:'platform-multi',\
665666
tag:'attack-protocol',\
666667
tag:'OWASP_CRS/PROTOCOL_VIOLATION/MISSING_HEADER_ACCEPT'"
667-
SecRule REQUEST_METHOD "!^OPTIONS$" \
668+
SecRule REQUEST_METHOD "!@rx ^OPTIONS$" \
668669
"chain"
669670
SecRule &REQUEST_HEADERS:User-Agent "@eq 0" \
670671
"t:none,\
@@ -683,7 +684,7 @@ SecRule REQUEST_HEADERS:Accept "^$" \
683684
# the existence of the User-Agent header.
684685
#
685686

686-
SecRule REQUEST_HEADERS:User-Agent "^$" \
687+
SecRule REQUEST_HEADERS:User-Agent "@rx ^$" \
687688
"msg:'Empty User Agent Header',\
688689
severity:'NOTICE',\
689690
phase:2,\
@@ -714,7 +715,7 @@ SecRule REQUEST_HEADERS:User-Agent "^$" \
714715
# -=[ References ]=-
715716
# http://httpwg.org/specs/rfc7231.html#header.content-type
716717

717-
SecRule REQUEST_HEADERS:Content-Length "!^0$" \
718+
SecRule REQUEST_HEADERS:Content-Length "!@rx ^0$" \
718719
"msg:'Request Containing Content, but Missing Content-Type header',\
719720
chain,\
720721
phase:2,\
@@ -745,7 +746,7 @@ SecRule REQUEST_HEADERS:Content-Length "!^0$" \
745746
# http://technet.microsoft.com/en-us/magazine/2005.01.hackerbasher.aspx
746747
#
747748

748-
SecRule REQUEST_HEADERS:Host "^[\d.:]+$" \
749+
SecRule REQUEST_HEADERS:Host "@rx ^[\d.:]+$" \
749750
"msg:'Host header is a numeric IP address',\
750751
phase:2,\
751752
rev:'2',\
@@ -934,7 +935,7 @@ SecRule &TX:COMBINED_FILE_SIZES "@eq 1" \
934935
#
935936
# Restrict which content-types we accept.
936937
#
937-
SecRule REQUEST_METHOD "!^(?:GET|HEAD|PROPFIND|OPTIONS)$" \
938+
SecRule REQUEST_METHOD "!@rx ^(?:GET|HEAD|PROPFIND|OPTIONS)$" \
938939
"phase:2,\
939940
chain,\
940941
t:none,\
@@ -954,10 +955,10 @@ SecRule REQUEST_METHOD "!^(?:GET|HEAD|PROPFIND|OPTIONS)$" \
954955
tag:'OWASP_TOP_10/A1',\
955956
tag:'OWASP_AppSensor/EE2',\
956957
tag:'PCI/12.1'"
957-
SecRule REQUEST_HEADERS:Content-Type "^([^;\s]+)" \
958+
SecRule REQUEST_HEADERS:Content-Type "@rx ^([^;\s]+)" \
958959
"chain,\
959960
capture"
960-
SecRule TX:0 "!^%{tx.allowed_request_content_type}$" \
961+
SecRule TX:0 "!@rx ^%{tx.allowed_request_content_type}$" \
961962
"t:none,\
962963
ctl:forceRequestBodyVariable=On,\
963964
setvar:'tx.msg=%{rule.msg}',\
@@ -992,7 +993,7 @@ SecRule REQUEST_PROTOCOL "!@within %{tx.allowed_http_versions}" \
992993
#
993994
# Restrict file extension
994995
#
995-
SecRule REQUEST_BASENAME "\.(.*)$" \
996+
SecRule REQUEST_BASENAME "@rx \.(.*)$" \
996997
"chain,\
997998
capture,\
998999
phase:2,\
@@ -1100,7 +1101,7 @@ SecRule TX:PARANOIA_LEVEL "@lt 2" "phase:2,id:920014,nolog,pass,skipAfter:END-RE
11001101
# -=[ References ]=-
11011102
# https://httpd.apache.org/security/CVE-2011-3192.txt
11021103

1103-
SecRule REQUEST_HEADERS:Range|REQUEST_HEADERS:Request-Range "^bytes=((\d+)?\-(\d+)?\s*,?\s*){6}" \
1104+
SecRule REQUEST_HEADERS:Range|REQUEST_HEADERS:Request-Range "@rx ^bytes=((\d+)?\-(\d+)?\s*,?\s*){6}" \
11041105
"phase:2,\
11051106
capture,\
11061107
rev:'2',\
@@ -1145,13 +1146,13 @@ SecRule REQUEST_BASENAME "@endsWith .pdf" \
11451146
tag:'OWASP_CRS/PROTOCOL_VIOLATION/INVALID_HREQ',\
11461147
tag:'paranoia-level/2',\
11471148
chain"
1148-
SecRule REQUEST_HEADERS:Range|REQUEST_HEADERS:Request-Range "^bytes=((\d+)?\-(\d+)?\s*,?\s*){63}" \
1149+
SecRule REQUEST_HEADERS:Range|REQUEST_HEADERS:Request-Range "@rx ^bytes=((\d+)?\-(\d+)?\s*,?\s*){63}" \
11491150
"setvar:'tx.msg=%{rule.msg}',\
11501151
setvar:tx.anomaly_score=+%{tx.warning_anomaly_score},\
11511152
setvar:tx.%{rule.id}-OWASP_CRS/PROTOCOL_VIOLATION/INVALID_HREQ-%{matched_var_name}=%{matched_var}"
11521153

11531154

1154-
SecRule ARGS "\%((?!$|\W)|[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})" \
1155+
SecRule ARGS "@rx \%((?!$|\W)|[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})" \
11551156
"phase:2,\
11561157
rev:'2',\
11571158
ver:'OWASP_CRS/3.0.0',\
@@ -1196,7 +1197,7 @@ SecRule &REQUEST_HEADERS:Accept "@eq 0" \
11961197
tag:'OWASP_TOP_10/A7',\
11971198
tag:'PCI/6.5.10',\
11981199
tag:'paranoia-level/2'"
1199-
SecRule REQUEST_METHOD "!^OPTIONS$" \
1200+
SecRule REQUEST_METHOD "!@rx ^OPTIONS$" \
12001201
"chain"
12011202
SecRule REQUEST_HEADERS:User-Agent "!@pm AppleWebKit Android" \
12021203
"t:none,\
@@ -1260,7 +1261,7 @@ SecRule &REQUEST_HEADERS:User-Agent "@eq 0" \
12601261
#
12611262
# PL2: This is a stricter sibling of 920120.
12621263
#
1263-
SecRule FILES_NAMES|FILES "['\";=]" \
1264+
SecRule FILES_NAMES|FILES "@rx ['\";=]" \
12641265
"msg:'Attempted multipart/form-data bypass',\
12651266
severity:'CRITICAL',\
12661267
id:920121,\
@@ -1339,7 +1340,7 @@ SecRule REQUEST_BASENAME "@endsWith .pdf" \
13391340
tag:'OWASP_CRS/PROTOCOL_VIOLATION/INVALID_HREQ',\
13401341
tag:'paranoia-level/4',\
13411342
chain"
1342-
SecRule REQUEST_HEADERS:Range|REQUEST_HEADERS:Request-Range "^bytes=((\d+)?\-(\d+)?\s*,?\s*){6}" \
1343+
SecRule REQUEST_HEADERS:Range|REQUEST_HEADERS:Request-Range "@rx ^bytes=((\d+)?\-(\d+)?\s*,?\s*){6}" \
13431344
"setvar:'tx.msg=%{rule.msg}',\
13441345
setvar:tx.anomaly_score=+%{tx.warning_anomaly_score},\
13451346
setvar:tx.%{rule.id}-OWASP_CRS/PROTOCOL_VIOLATION/INVALID_HREQ-%{matched_var_name}=%{matched_var}"
@@ -1417,7 +1418,7 @@ SecRule REQUEST_HEADERS|!REQUEST_HEADERS:User-Agent|!REQUEST_HEADERS:Referer|!RE
14171418
# negative look-behind construct. If that is the case, the backslash character
14181419
# is allowed.
14191420
#
1420-
SecRule REQUEST_URI|REQUEST_HEADERS|ARGS|ARGS_NAMES "(?<!\Q\\\E)\Q\\\E[cdeghijklmpqwxyz123456789]" \
1421+
SecRule REQUEST_URI|REQUEST_HEADERS|ARGS|ARGS_NAMES "@rx (?<!\Q\\\E)\Q\\\E[cdeghijklmpqwxyz123456789]" \
14211422
"phase:2,\
14221423
id:920460,\
14231424
rev:'1',\

0 commit comments

Comments
 (0)