1313#
1414# The purpose of this rules file is to enforce HTTP RFC requirements that state how
1515# the client is supposed to interact with the server.
16- # http ://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html
16+ # https ://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html
1717
1818
1919
@@ -41,7 +41,7 @@ SecRule TX:PARANOIA_LEVEL "@lt 1" "phase:2,id:920012,nolog,pass,skipAfter:END-RE
4141# It also outlines proper construction for CONNECT, OPTIONS and GET requests.
4242#
4343# -=[ References ]=-
44- # http ://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.2.1
44+ # https ://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.2.1
4545# http://capec.mitre.org/data/definitions/272.html
4646#
4747SecRule 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]*)?)$" \
@@ -128,7 +128,7 @@ SecRule FILES_NAMES|FILES "@rx (?<!&(?:[aAoOuUyY]uml)|&(?:[aAeEiIoOuU]circ)|&(?:
128128# by the request body processor if it encounters errors.
129129#
130130# -=[ References ]=-
131- # https://sourceforge.net/apps/mediawiki/mod-security/index.php?title=Reference_Manual #REQBODY_ERROR
131+ # https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual #REQBODY_ERROR
132132#
133133SecRule REQBODY_ERROR "!@eq 0" \
134134 "id:920130,\
@@ -161,7 +161,7 @@ SecRule REQBODY_ERROR "!@eq 0" \
161161# _not_ to remove it altogether.
162162#
163163# -=[ References ]=-
164- # https://sourceforge.net/apps/mediawiki/mod-security/index.php?title=Reference_Manual #MULTIPART_STRICT_ERROR
164+ # https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual #MULTIPART_STRICT_ERROR
165165#
166166SecRule MULTIPART_STRICT_ERROR "!@eq 0" \
167167 "id:920140,\
@@ -202,7 +202,7 @@ SecRule MULTIPART_STRICT_ERROR "!@eq 0" \
202202# is NOT all digits, then it will match.
203203#
204204# -=[ References ]=-
205- # http ://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
205+ # https ://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13
206206#
207207SecRule REQUEST_HEADERS:Content-Length "!@rx ^\d+$" \
208208 "id:920160,\
@@ -238,7 +238,7 @@ SecRule REQUEST_HEADERS:Content-Length "!@rx ^\d+$" \
238238# empty, then it will match.
239239#
240240# -=[ References ]=-
241- # http ://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3
241+ # https ://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3
242242#
243243SecRule REQUEST_METHOD "@rx ^(?:GET|HEAD)$" \
244244 "id:920170,\
@@ -272,7 +272,7 @@ SecRule REQUEST_METHOD "@rx ^(?:GET|HEAD)$" \
272272# header is also present.
273273#
274274# -=[ References ]=-
275- # http ://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5
275+ # https ://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5
276276#
277277SecRule REQUEST_METHOD "@rx ^POST$" \
278278 "id:920180,\
@@ -308,7 +308,8 @@ SecRule REQUEST_METHOD "@rx ^POST$" \
308308# This rule inspects the Range request header to see if it starts with 0.
309309#
310310# -=[ References ]=-
311- # http://www.bad-behavior.ioerror.us/documentation/how-it-works/
311+ # http://www.bad-behavior.ioerror.us/about/
312+ # https://tools.ietf.org/html/rfc7233
312313#
313314# 2. Per RFC 2616 -
314315# "If the last-byte-pos value is present, it MUST be greater than or equal to the first-byte-pos in that byte-range-spec,
@@ -317,7 +318,7 @@ SecRule REQUEST_METHOD "@rx ^POST$" \
317318# This rule compares the first and second byte ranges and flags when the first value is greater than the second.
318319#
319320# -=[ References ]=-
320- # http ://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
321+ # https ://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
321322# http://seclists.org/fulldisclosure/2011/Aug/175
322323#
323324SecRule REQUEST_HEADERS:Range|REQUEST_HEADERS:Request-Range "@rx (\d+)\-(\d+)\," \
@@ -352,7 +353,8 @@ SecRule REQUEST_HEADERS:Range|REQUEST_HEADERS:Request-Range "@rx (\d+)\-(\d+)\,"
352353# keep-alive and close options.
353354#
354355# -=[ References ]=-
355- # http://www.bad-behavior.ioerror.us/documentation/how-it-works/
356+ # http://www.bad-behavior.ioerror.us/about/
357+ # https://tools.ietf.org/html/rfc7233
356358#
357359SecRule REQUEST_HEADERS:Connection "@rx \b(?:keep-alive|close),\s?(?:keep-alive|close)\b" \
358360 "id:920210,\
@@ -743,7 +745,7 @@ SecRule REQUEST_HEADERS:Content-Length "!@rx ^0$" \
743745# This rule triggers if the Host header contains all digits (and possible port)
744746#
745747# -=[ References ]=-
746- # http ://technet.microsoft.com/en-us/magazine/2005.01.hackerbasher.aspx
748+ # https ://technet.microsoft.com/en-us/magazine/2005.01.hackerbasher.aspx
747749#
748750
749751SecRule REQUEST_HEADERS:Host "@rx ^[\d.:]+$" \
0 commit comments