From 341f5bae1456045cf583d0ec46527e3be9768d35 Mon Sep 17 00:00:00 2001 From: Esad Cetiner <104706115+EsadCetiner@users.noreply.github.com> Date: Sat, 21 Dec 2024 00:18:29 +1100 Subject: [PATCH] fix: editing tag false positive (#65) * fix: editing tag false positive * fix: editing tag false positive * fix: check log output correctly * fix: move `ARGS_NAMES:users[0]` to it's own rule * up --- plugins/wordpress-rule-exclusions-before.conf | 6 +++ .../9507100.yaml | 4 +- .../9507121.yaml | 2 +- .../9507139.yaml | 2 +- .../9507140.yaml | 2 +- .../9507201.yaml | 2 +- .../9507350.yaml | 45 +++++++++++++++---- 7 files changed, 48 insertions(+), 15 deletions(-) diff --git a/plugins/wordpress-rule-exclusions-before.conf b/plugins/wordpress-rule-exclusions-before.conf index ac2bb2d..9550036 100644 --- a/plugins/wordpress-rule-exclusions-before.conf +++ b/plugins/wordpress-rule-exclusions-before.conf @@ -466,6 +466,7 @@ SecRule REQUEST_FILENAME "@unconditionalMatch" \ ctl:ruleRemoveTargetById=931130;ARGS:_wp_http_referer,\ ctl:ruleRemoveTargetById=932150;ARGS:_wp_http_referer,\ ctl:ruleRemoveTargetById=932200;ARGS:_wp_http_referer,\ + ctl:ruleRemoveTargetById=932235;ARGS:_wp_http_referer,\ ctl:ruleRemoveTargetById=932236;ARGS:_wp_http_referer,\ ctl:ruleRemoveTargetById=941100;ARGS:_wp_http_referer,\ ctl:ruleRemoveTargetById=942130;ARGS:_wp_http_referer,\ @@ -477,6 +478,7 @@ SecRule REQUEST_FILENAME "@unconditionalMatch" \ ctl:ruleRemoveTargetById=942432;ARGS:_wp_http_referer,\ ctl:ruleRemoveTargetById=942440;ARGS:_wp_http_referer,\ ctl:ruleRemoveTargetById=920230;ARGS:wp_http_referer,\ + ctl:ruleRemoveTargetById=920273;ARGS:wp_http_referer,\ ctl:ruleRemoveTargetById=931130;ARGS:wp_http_referer,\ ctl:ruleRemoveTargetById=932150;ARGS:wp_http_referer,\ ctl:ruleRemoveTargetById=932200;ARGS:wp_http_referer,\ @@ -488,6 +490,7 @@ SecRule REQUEST_FILENAME "@unconditionalMatch" \ ctl:ruleRemoveTargetById=942230;ARGS:wp_http_referer,\ ctl:ruleRemoveTargetById=942260;ARGS:wp_http_referer,\ ctl:ruleRemoveTargetById=942431;ARGS:wp_http_referer,\ + ctl:ruleRemoveTargetById=942432;ARGS:wp_http_referer,\ ctl:ruleRemoveTargetById=932236;ARGS:_wpnonce,\ ctl:ruleRemoveTargetById=942450;ARGS:_wpnonce,\ ver:'wordpress-rule-exclusions-plugin/1.0.1'" @@ -624,6 +627,7 @@ SecRule REQUEST_FILENAME "@endsWith /wp-admin/user-new.php" \ ctl:ruleRemoveTargetByTag=OWASP_CRS;ARGS:pass2" # The ID variable is used all over wordpress +# Managing users SecRule REQUEST_FILENAME "@rx /wp-admin/(?:admin|admin-ajax|edit|users)\.php$" \ "id:9507601,\ phase:1,\ @@ -632,6 +636,8 @@ SecRule REQUEST_FILENAME "@rx /wp-admin/(?:admin|admin-ajax|edit|users)\.php$" \ nolog,\ ctl:ruleRemoveTargetById=932236;ARGS_NAMES:id,\ ctl:ruleRemoveTargetById=932236;ARGS_NAMES:ids,\ + ctl:ruleRemoveTargetById=920273;ARGS_NAMES:users[0],\ + ctl:ruleRemoveTargetById=942432;ARGS_NAMES:users[0],\ ver:'wordpress-rule-exclusions-plugin/1.0.1'" # diff --git a/tests/regression/wordpress-rule-exclusions-plugin/9507100.yaml b/tests/regression/wordpress-rule-exclusions-plugin/9507100.yaml index 1de7220..4c65f81 100644 --- a/tests/regression/wordpress-rule-exclusions-plugin/9507100.yaml +++ b/tests/regression/wordpress-rule-exclusions-plugin/9507100.yaml @@ -20,7 +20,7 @@ tests: version: "HTTP/1.1" uri: /post/wp-login.php?pwd=