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

Fix FP in 941130 and rearrange regex with new regex-assemble file #1701

Merged
merged 2 commits into from
Feb 26, 2020
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
7 changes: 6 additions & 1 deletion rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,12 @@ SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_H
#
# -=[ XSS Filters - Category 3 ]=-
#
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_HEADERS:User-Agent|ARGS_NAMES|ARGS|XML:/* "@rx (?i)[\s\S]((?:x(?:link:href|html|mlns)|!ENTITY.*?(?:SYSTEM|PUBLIC)|data:text\/html|formaction|\@import|base64)\b|pattern\b.*?=)" \
# Regexp generated from util/regexp-assemble/regexp-941130.data using Regexp::Assemble.
# To rebuild the regexp:
# cd util/regexp-assemble
# ./regexp-assemble.pl regexp-941130.data
#
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_HEADERS:User-Agent|ARGS_NAMES|ARGS|XML:/* "@rx (?i)[\s\S](?:!ENTITY.*?(?:PUBLIC|SYSTEM)|x(?:link:href|html|mlns)|data:text\/html|pattern\b.*?=|formaction|\@import|;base64)\b" \
"id:941130,\
phase:2,\
block,\
Expand Down
10 changes: 10 additions & 0 deletions util/regexp-assemble/regexp-941130.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(?i)[\s\S]xlink:href\b
(?i)[\s\S]xhtml\b
(?i)[\s\S]xmlns\b
(?i)[\s\S]!ENTITY.*?SYSTEM\b
(?i)[\s\S]!ENTITY.*?PUBLIC\b
(?i)[\s\S]data:text/html\b
(?i)[\s\S]formaction\b
(?i)[\s\S]@import\b
(?i)[\s\S];base64\b
(?i)[\s\S]pattern\b.*?=\b