WordPress Calculated Fields Form 1.0.x Session Hijacking

Type packetstorm
Reporter Joaquin Ramirez Martinez
Modified 2016-02-24T00:00:00


                                            `# Exploit Title: WordPress Calculated Fields Form <=1.0.x - Http_only bypass & admin session hijackig.  
# Date: 2016-02-22  
# Google Dork: Index of /wp-content/plugins/calculated-fields-form/  
# Exploit Author: Joaquin Ramirez Martinez [ i0akiN SEC-LABORATORY ]  
# Plugin URI: http://wordpress.dwbooster.com/forms/calculated-fields-form  
# Version: 1.0.x  
# Demo: https://www.youtube.com/watch?v=B_RGAAscEFc  
Calculated Fields Form is a plugin for creating forms with dynamically calculated fields and display the result.  
With Calculated Fields Form you can create **forms with dynamically calculated fields** to **display the   
calculated values**.  
It includes a **form builder** for adding/editing different field types, including one or more **automatically   
calculated fields** based in the data entered in other fields.  
Calculated Fields Form can be used for creating both single and complex calculations, for example general   
calculators, ideal weight calculators, calorie calculators, calculate quotes for hotel booking and rent a car  
services, calculate quotes for appointments and services, loan & finance calculators, date calculators like   
pregnancy calculators, etc...  
Technical details  
Cp calculated fields form is prone to a session hijacking vulnerability because contains a shortcode function   
that reads http_only cookies and also is vulnerable to persistent cross-site scripting attacks by an authenticated   
The attacker must have an account like author or editor for create posts and embed malicious shortcodes and hijack  
admin or other user's sessions.  
Proof of concept  
An author can insert the following shortcodes into a post with the cookie name that want to read...  
[CP_CALCULATED_FIELDS_VAR name="cookie_to_steal" from="COOKIE"]  
[CP_CALCULATED_FIELDS id="1" a='s\\";;alert(cookie_to_steal);//'] -->default calculated field created by the plugin  
as you can see, i injected an xss payload   
bypassing the shortcode atts value restrictions.  
See the PoC video: https://www.youtube.com/watch?v=B_RGAAscEFc  
Note: The ´wordpress_logged_in...´ cookie is different in each wordpress installation, but it doesn't matter  
if you want to hijack the session of an administrator on the same wordpress installation, the cookie will be   
called of the same manner.  
Vulnerability discovered by:  
Joaquin Ramirez Martinez [i0 security-lab]  
2016-02-10 vulnerability discovered  
2016-02-22 reported to vendor