Skip to content

Commit 2f0e66f

Browse files
committed
Make multipart boundary check a bit less strict by default
1 parent 68398a5 commit 2f0e66f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

modsecurity.conf-recommended

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,22 @@ FL %{MULTIPART_FILE_LIMIT_EXCEEDED}'"
102102
# is wrong, then parser returns with value 1 (also a non-zero).
103103
#
104104
# You can choose, which one is what you need. The example below contains the
105-
# 'strict' mode, which means if there are any lines with start of "--", then
106-
# ModSecurity blocked the content. But the next, commented example contains
105+
# 'strict' logging mode, which means if there are any lines with start of "--", then
106+
# ModSecurity warns about the request. But the next, example contains
107107
# the 'permissive' mode, then you check only if the necessary lines exists in
108108
# correct order. Whit this, you can enable to upload PEM files (eg "----BEGIN.."),
109109
# or other text files, which contains eg. HTTP headers.
110110
#
111-
# The difference is only the operator - in strict mode (first) the content blocked
111+
# The difference is only the operator - in strict mode (first) the content logs
112112
# in case of any non-zero value. In permissive mode (second, commented) the
113113
# content blocked only if the value is explicit 1. If it 0 or 2, the content will
114114
# allowed.
115115
#
116116

117117
SecRule MULTIPART_UNMATCHED_BOUNDARY "!@eq 0" \
118-
"id:'200004',phase:2,t:none,log,deny,msg:'Multipart parser detected a possible unmatched boundary.'"
119-
#SecRule MULTIPART_UNMATCHED_BOUNDARY "@eq 1" \
120-
#"id:'200004',phase:2,t:none,log,deny,msg:'Multipart parser detected a possible unmatched boundary.'"
121-
118+
"id:'200004',phase:2,t:none,log,pass,msg:'Multipart parser detected a possible unmatched boundary.'"
119+
SecRule MULTIPART_UNMATCHED_BOUNDARY "@eq 1" \
120+
"id:'200006',phase:2,t:none,log,deny,msg:'Multipart parser detected a possible unmatched boundary.'"
122121

123122
# PCRE Tuning
124123
# We want to avoid a potential RegEx DoS condition

0 commit comments

Comments
 (0)