VikBooking Hotel Booking Engine & PMS <= 1.8.8 - Unauthenticated Stored Cross-Site Scripting
Description
The VikBooking Hotel Booking Engine & PMS plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to, and including, 1.8.8 due to insufficient input sanitization and output escaping. This makes it possible for unauthenticated attackers to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:NTechnical Details
What Changed in the Fix
Changes introduced in v1.8.9
Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2026-42683 (VikBooking Hotel Booking Engine & PMS) ## 1. Vulnerability Summary The **VikBooking Hotel Booking Engine & PMS** plugin (versions <= 1.8.8) is vulnerable to **Unauthenticated Stored Cross-Site Scripting (XSS)**. The vulnerability exists because the plug…
Show full research plan
Exploitation Research Plan: CVE-2026-42683 (VikBooking Hotel Booking Engine & PMS)
1. Vulnerability Summary
The VikBooking Hotel Booking Engine & PMS plugin (versions <= 1.8.8) is vulnerable to Unauthenticated Stored Cross-Site Scripting (XSS). The vulnerability exists because the plugin's Quotation system accepts user-supplied input (specifically customer details and message content) via unauthenticated AJAX endpoints and stores it in the database without sufficient sanitization. When an administrative user views the "Quotations" or "Booking Details" page in the WordPress dashboard, these stored scripts are executed in the admin's browser context.
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - Action:
vbo_ajax_quote(inferred from controller namequoteand common VikBooking AJAX routing) orvikbooking_ajaxwithcontroller=quoteandtask=save. - Vulnerable Parameters:
quote[customer][first_name]quote[customer][last_name]quote[message][subject]quote[message][content]
- Authentication: None (Privileges Required: None).
- Preconditions: The "Quotation" feature must be active (default in most configurations). A valid Room ID and Rate Plan ID are required to pass the
solutionsvalidation inadmin/controllers/quote.php.
3. Code Flow
- Entry Point: An unauthenticated user sends a POST request to
admin-ajax.phptargeting thequotecontroller andsavetask. - Controller Logic (
admin/controllers/quote.php):- The
save()method is called. - It retrieves the
quotearray from$app->input->get('quote', [], 'array'). - It validates "solutions" (check-in, check-out, room ID, etc.).
- It calls
$customerModel->save($customerInfo)to store the customer. - It calls
$quoteModel->save([...])using the data from$quote['message'].
- The
- Model Storage (
admin/helpers/src/model/quote.php):- The
preflight()method is called before saving. It setscreated_by(defaults to 'User' for unauthenticated) and captures the attacker's IP. - The data is inserted into the
#__vikbooking_quotationstable using$this->tableName.
- The
- Sink (Admin View):
- When an admin views the dashboard or the Quotations list, the model's
loadBookingRecords()fetches the data. - The
subject,message, andfirst_namefields are rendered in the admin UI. Based on the vulnerability report, these are not escaped usingesc_html()or similar functions at the point of output.
- When an admin views the dashboard or the Quotations list, the model's
4. Nonce Acquisition Strategy
The save() method in admin/controllers/quote.php performs a CSRF check using JSession::checkToken(). In VikBooking's WordPress implementation, this token is typically provided to the front-end to allow unauthenticated users to submit quotes.
Strategy:
- Identify Entry Point: The "Request a Quote" functionality is usually embedded via the
[vikbooking_room]shortcode or reachable via the search results. - Setup: Create a dummy room to ensure the script and nonce are enqueued.
wp post create --post_type=page --post_status=publish --post_title="Booking" --post_content='[vikbooking_search]' - Acquisition:
- Navigate to the page using
browser_navigate. - The nonce is typically stored in a global JavaScript object named
vbo_paramsorvbo_quote_params. - JavaScript Variable:
window.vbo_params?.vbo_tokenor a hidden input field namedvbo_token. - Action String: The token check in
JSession::checkToken()validates against the session-based token generated for the unauthenticated user.
- Navigate to the page using
5. Exploitation Strategy
- Prepare Payload: Use a standard XSS payload targeting
quote[message][subject].- Payload:
<script>alert(document.domain)</script>
- Payload:
- Identify Required IDs: Query the database for an existing Room ID and Rate Plan ID.
- Room ID:
SELECT id FROM wp_vikbooking_rooms LIMIT 1; - Rate Plan ID:
SELECT id FROM wp_vikbooking_prices LIMIT 1;
- Room ID:
- Send Exploit Request: Use
http_requestto submit the quote.- URL:
http://localhost:8080/wp-admin/admin-ajax.php?action=vikbooking_ajax&controller=quote&task=save - Method: POST
- Headers:
Content-Type: application/x-www-form-urlencoded - Body:
vbo_token=[EXTRACTED_NONCE]"e[customer][first_name]=Attacker"e[customer][email]=attacker@example.com"e[message][subject]=<script>alert(1)</script>"e[message][content]=Help"e[solutions][0][checkin]=2025-12-01"e[solutions][0][checkout]=2025-12-05"e[solutions][0][rooms][0][id]=[ROOM_ID]"e[solutions][0][rooms][0][id_price]=[RATE_ID]"e[solutions][0][rooms][0][adults]=1"e[solutions][0][rooms][0][room_cost]=100
- URL:
6. Test Data Setup
- Ensure Plugin is Active:
wp plugin activate vikbooking - Create Required Entities:
- Create a room:
wp vikbooking room create --name="Luxury Suite" --units=5(if CLI supports it) or via SQL:INSERT INTO `wp_vikbooking_rooms` (`name`, `units`, `avail`) VALUES ('Test Room', 1, 1); SET @room_id = LAST_INSERT_ID(); INSERT INTO `wp_vikbooking_prices` (`idroom`, `name`, `price`) VALUES (@room_id, 'Standard Rate', 100);
- Create a room:
- Create Page: Create the page as described in Section 4 to trigger script localization.
7. Expected Results
- The AJAX request should return a
200 OKwith a JSON object containing theidof the newly created quotation. - The
wp_vikbooking_quotationstable should contain a row where thesubjectcolumn is exactly<script>alert(1)</script>. - When an admin navigates to
/wp-admin/admin.php?page=vikbooking&view=quotations, the browser should trigger the alert.
8. Verification Steps
- Check Database:
wp db query "SELECT subject FROM wp_vikbooking_quotations WHERE first_name='Attacker'" - Confirm Unsanitized Storage: Verify that the output of the query shows the raw
<script>tag, confirming the lack of sanitization in theVBOModelQuote::savepath.
9. Alternative Approaches
If the quote controller is not reachable or requires higher privileges, target the add_fest method in VikBookingController (admin/controller.php):
- Task:
add_fest - Parameters:
name,descr,dt. - Note: This method is inside
VikBookingControllerand is triggered viaaction=vikbooking_ajax&task=add_fest. If the main controller lacks thecheckTokencheck (not visible in the provided snippet), it may be even easier to exploit.
Summary
The VikBooking Hotel Booking Engine & PMS plugin for WordPress is vulnerable to unauthenticated stored cross-site scripting (XSS) via the Quotation system. Attackers can inject malicious scripts into fields like the message subject or customer name through an unauthenticated AJAX endpoint, which are then executed when an administrative user views the quotations or booking details in the dashboard.
Vulnerable Code
// admin/controllers/quote.php (lines 135-207) public function save() { $app = JFactory::getApplication(); // ... $quote = $app->input->get('quote', [], 'array'); // ... $quoteId = $quoteModel->save([ 'name' => ($quote['name'] ?? '') ?: date('Y-m-d H:i:s'), 'subject' => $quote['message']['subject'] ?? null, 'message' => $quote['message']['content'] ?? null, 'notes' => $quote['message']['notes'] ?? null, // ... 'first_name' => $quote['customer']['first_name'], // ... ]); --- // admin/helpers/widgets/booking_details.php (line 684) <blockquote class="vbo-booking-admin-notes"><?php echo nl2br($details['adminnotes']); ?></blockquote> --- // admin/controller.php (line 11173) $cstring_search .= '<div class="' . $selector . '" data-custid="'.$v['id'].'" data-email="'.$v['email'].'" data-phone="'.htmlspecialchars($v['phone']).'" data-country="'.$v['country'].'" data-pin="'.$v['pin'].'" data-firstname="'.htmlspecialchars($v['first_name']).'" data-lastname="'.htmlspecialchars($v['last_name']).'">' . "\n";
Security Fix
@@ -11170,7 +11205,7 @@ $cust_old_fields = array(); $cstring_search = '<div class="vbo-custsearchres-inner">' . "\n"; foreach ($customers as $k => $v) { - $cstring_search .= '<div class="' . $selector . '" data-custid="'.$v['id'].'" data-email="'.$v['email'].'" data-phone="'.htmlspecialchars($v['phone']).'" data-country="'.$v['country'].'" data-pin="'.$v['pin'].'" data-firstname="'.htmlspecialchars($v['first_name']).'" data-lastname="'.htmlspecialchars($v['last_name']).'">' . "\n"; + $cstring_search .= '<div class="' . $selector . '" data-custid="' . (int) $v['id'] . '" data-email="' . htmlspecialchars($v['email']) . '" data-phone="' . htmlspecialchars($v['phone']) . '" data-country="' . htmlspecialchars($v['country']) . '" data-pin="' . htmlspecialchars($v['pin']) . '" data-firstname="' . htmlspecialchars($v['first_name']) . '" data-lastname="' . htmlspecialchars($v['last_name']) . '">' . "\n"; $cstring_search .= '<span class="vbo-custsearchres-cflag">'; if (!empty($v['pic'])) { $cstring_search .= '<img src="' . (strpos($v['pic'], 'http') === 0 ? $v['pic'] : VBO_SITE_URI . 'resources/uploads/' . $v['pic']) . '" class="vbo-country-flag vbo-customer-avatar-flag"/>' . "\n"; @@ -681,7 +681,7 @@ <div class="vbo-params-block"> <div class="vbo-param-container"> <div class="vbo-param-setting"> - <blockquote class="vbo-booking-admin-notes"><?php echo nl2br($details['adminnotes']); ?></blockquote> + <blockquote class="vbo-booking-admin-notes"><?php echo nl2br(htmlspecialchars($details['adminnotes'])); ?></blockquote> </div> </div> </div>
Exploit Outline
To exploit this vulnerability, an unauthenticated attacker first obtains a valid session nonce (vbo_token) by visiting a public-facing room or search page where VikBooking scripts are localized. The attacker then identifies a valid Room ID and Rate Plan ID, which are necessary for the quotation logic to pass initial validation. Using these parameters, the attacker sends a POST request to the `/wp-admin/admin-ajax.php?action=vikbooking_ajax&controller=quote&task=save` endpoint. The payload, containing an arbitrary script (e.g., <script>alert(1)</script>), is placed within parameters such as `quote[message][subject]` or `quote[customer][first_name]`. Upon successful submission, the script is stored in the database. The XSS triggers whenever an administrator views the Quotations list or Booking Details page in the WordPress admin panel, as the plugin fails to escape these values before rendering them in the HTML output.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.