Skip to content

Commit

Permalink
Merge branch 'coreruleset:master' into fix-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
EsadCetiner authored Nov 26, 2024
2 parents cfb12aa + 01808dd commit e17482c
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
27 changes: 27 additions & 0 deletions plugins/wordpress-rule-exclusions-before.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1126,4 +1126,31 @@ SecRule REQUEST_FILENAME "@endsWith /wp-admin/admin-ajax.php" \
"t:none,\
ctl:ruleRemoveTargetById=942360;ARGS:s"

# Uploading plugins as a zip file
SecRule REQUEST_FILENAME "@endsWith /wp-admin/update.php" \
"id:9507973,\
phase:2,\
pass,\
t:none,\
nolog,\
ver:'wordpress-rule-exclusions-plugin/1.0.1',\
chain"
SecRule ARGS:action "@streq upload-plugin" \
"t:none,\
chain"
SecRule FILES:pluginzip "@endsWith .zip" \
"t:none,\
ctl:ruleRemoveTargetById=944110;REQUEST_BODY,\
ctl:ruleRemoveTargetById=944250;REQUEST_BODY"

# Installing a plugin via zip file upload
SecRule REQUEST_FILENAME "@endsWith /wp-admin/update.php" \
"id:9507974,\
phase:1,\
pass,\
t:none,\
nolog,\
ver:'wordpress-rule-exclusions-plugin/1.0.1',\
ctl:ruleRemoveTargetById=932236;ARGS:install-plugin-submit"

SecMarker "END-WORDPRESS-ADMIN"
43 changes: 43 additions & 0 deletions tests/regression/wordpress-rule-exclusions-plugin/9507974.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
meta:
author: "Esad Cetiner"
description: "Wordpress Rule Exclusions Plugin"
enabled: true
name: 9507974.yaml
tests:
- test_title: 9507974-1
desc: Installing a plugin via zip file upload
stages:
- stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: "OWASP CRS test agent"
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Content-Type: "multipart/form-data; boundary=----WebKitFormBoundarylBwlewqbn4fBRA7B"
port: 80
method: POST
version: "HTTP/1.1"
uri: /post/wp-admin/update.php?action=upload-plugin
data: |
------WebKitFormBoundarylBwlewqbn4fBRA7B
Content-Disposition: form-data; name="_wpnonce"
7347be877b
------WebKitFormBoundarylBwlewqbn4fBRA7B
Content-Disposition: form-data; name="_wp_http_referer"
/wp-admin/plugin-install.php
------WebKitFormBoundarylBwlewqbn4fBRA7B
Content-Disposition: form-data; name="pluginzip"; filename="akismet.5.3.3.zip"
Content-Type: application/x-zip-compressed
<Plugin data goes here>
------WebKitFormBoundarylBwlewqbn4fBRA7B
Content-Disposition: form-data; name="install-plugin-submit"
Install Now
------WebKitFormBoundarylBwlewqbn4fBRA7B--
output:
no_log_contains: id "932236"

0 comments on commit e17482c

Please sign in to comment.