Skip to content

Commit 01808dd

Browse files
fix: fp when installing/uploading plugin via zip file (#62)
* fix: fp when installing/uploading plugin via zip file * perf: remove unneeded chain rule --------- Co-authored-by: Max Leske <[email protected]>
1 parent b89a73b commit 01808dd

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

Diff for: plugins/wordpress-rule-exclusions-before.conf

+27
Original file line numberDiff line numberDiff line change
@@ -1121,4 +1121,31 @@ SecRule REQUEST_FILENAME "@endsWith /wp-admin/admin-ajax.php" \
11211121
"t:none,\
11221122
ctl:ruleRemoveTargetById=942360;ARGS:s"
11231123

1124+
# Uploading plugins as a zip file
1125+
SecRule REQUEST_FILENAME "@endsWith /wp-admin/update.php" \
1126+
"id:9507973,\
1127+
phase:2,\
1128+
pass,\
1129+
t:none,\
1130+
nolog,\
1131+
ver:'wordpress-rule-exclusions-plugin/1.0.1',\
1132+
chain"
1133+
SecRule ARGS:action "@streq upload-plugin" \
1134+
"t:none,\
1135+
chain"
1136+
SecRule FILES:pluginzip "@endsWith .zip" \
1137+
"t:none,\
1138+
ctl:ruleRemoveTargetById=944110;REQUEST_BODY,\
1139+
ctl:ruleRemoveTargetById=944250;REQUEST_BODY"
1140+
1141+
# Installing a plugin via zip file upload
1142+
SecRule REQUEST_FILENAME "@endsWith /wp-admin/update.php" \
1143+
"id:9507974,\
1144+
phase:1,\
1145+
pass,\
1146+
t:none,\
1147+
nolog,\
1148+
ver:'wordpress-rule-exclusions-plugin/1.0.1',\
1149+
ctl:ruleRemoveTargetById=932236;ARGS:install-plugin-submit"
1150+
11241151
SecMarker "END-WORDPRESS-ADMIN"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
meta:
3+
author: "Esad Cetiner"
4+
description: "Wordpress Rule Exclusions Plugin"
5+
enabled: true
6+
name: 9507974.yaml
7+
tests:
8+
- test_title: 9507974-1
9+
desc: Installing a plugin via zip file upload
10+
stages:
11+
- stage:
12+
input:
13+
dest_addr: 127.0.0.1
14+
headers:
15+
Host: localhost
16+
User-Agent: "OWASP CRS test agent"
17+
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
18+
Content-Type: "multipart/form-data; boundary=----WebKitFormBoundarylBwlewqbn4fBRA7B"
19+
port: 80
20+
method: POST
21+
version: "HTTP/1.1"
22+
uri: /post/wp-admin/update.php?action=upload-plugin
23+
data: |
24+
------WebKitFormBoundarylBwlewqbn4fBRA7B
25+
Content-Disposition: form-data; name="_wpnonce"
26+
27+
7347be877b
28+
------WebKitFormBoundarylBwlewqbn4fBRA7B
29+
Content-Disposition: form-data; name="_wp_http_referer"
30+
31+
/wp-admin/plugin-install.php
32+
------WebKitFormBoundarylBwlewqbn4fBRA7B
33+
Content-Disposition: form-data; name="pluginzip"; filename="akismet.5.3.3.zip"
34+
Content-Type: application/x-zip-compressed
35+
<Plugin data goes here>
36+
37+
------WebKitFormBoundarylBwlewqbn4fBRA7B
38+
Content-Disposition: form-data; name="install-plugin-submit"
39+
40+
Install Now
41+
------WebKitFormBoundarylBwlewqbn4fBRA7B--
42+
output:
43+
no_log_contains: id "932236"

0 commit comments

Comments
 (0)