Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions regex-assembly/930110.ra
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
##! Please refer to the documentation at
##! https://coreruleset.org/docs/development/regex_assembly/.

##! Path Traversal Attack detection for decoded payloads (/../) or (/.../)
##! Also detects semicolon-based traversal (;..;) for Tomcat reverse proxy bypass
##!
##! To prevent '..' alone from triggering, the regexp requires a path
##! separator (/, \, or ;) on at least one side of the dots:
##! - ../ or ..\ or ..; (dots followed by separator)
##! - /.. or \.. or ;.. (separator followed by dots)

##!> define sep [\x5c/;]

##!> assemble
^
{{sep}}
##!<
##!=>
\.{2,3}{{sep}}
7 changes: 6 additions & 1 deletion rules/REQUEST-930-APPLICATION-ATTACK-LFI.conf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ SecRule REQUEST_URI_RAW|ARGS|REQUEST_HEADERS|!REQUEST_HEADERS:Referer|FILES|XML:
#
# Semicolon added to prevent path traversal via reverse proxy mapping '/..;/' (Tomcat)
#
SecRule REQUEST_URI_RAW|ARGS|REQUEST_HEADERS|!REQUEST_HEADERS:Referer|FILES|XML:/* "@rx (?:(?:^|[\x5c/;])\.{2,3}[\x5c/;]|[\x5c/;]\.{2,3}[\x5c/;])" \
# Regular expression generated from regex-assembly/930110.ra.
# To update the regular expression run the following shell script
# (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
# crs-toolchain regex update 930110
#
SecRule REQUEST_URI_RAW|ARGS|REQUEST_HEADERS|!REQUEST_HEADERS:Referer|FILES|XML:/* "@rx (?:^|[/;\x5c])\.{2,3}[/;\x5c]" \
"id:930110,\
phase:2,\
block,\
Expand Down
Loading