CVE-2026-57395

Tourfic – AI Powered Travel Booking, Hotel Booking & Car Rental WordPress Plugin <= 2.22.5 - Missing Authorization

mediumMissing Authorization
4.3
CVSS Score
4.3
CVSS Score
medium
Severity
2.22.6
Patched in
7d
Time to patch

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:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
None
Confidentiality
Low
Integrity
None
Availability

Technical Details

Affected versions<=2.22.5
PublishedJuly 8, 2026
Last updatedJuly 14, 2026
Affected plugintourfic

What Changed in the Fix

Changes introduced in v2.22.6

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

# 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 from tourfic-admin-api.min.js)
  • Alternative Action: tf_duplicate_post_data (identified from tourfic-admin-scripts.min.js)
  • Authentication: Authenticated (customer role and above).
  • Payload Parameter: action, nonce, and action-specific fields (e.g., name for the key).
  • Preconditions: The attacker must be logged in as a user with the customer role (common in WooCommerce/Booking sites).

3. Code Flow

  1. The plugin registers the AJAX handler in its main class or an admin include file using add_action('wp_ajax_tf_generate_api_key', '...').
  2. The handler function likely begins with check_ajax_referer('tf_api_nonce', 'nonce') (or similar) to validate the request origin.
  3. Vulnerability: The function proceeds to generate an API key and save it to the database/options table without calling current_user_can('manage_options').
  4. Because the customer role is an authenticated role, the wp_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.

  1. Identify Target Page: The scripts are likely loaded on the Tourfic Settings page in the dashboard. If the customer role has access to any Tourfic-related frontend dashboard (e.g., vendor dashboard), the scripts may load there.
  2. 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.
  3. 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_eval to 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"
      

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:
    action=tf_duplicate_post_data&postID=1&postType=tf_hotel&security={{extracted_tf_nonce}}
    
    (Note: security is the parameter name used for the nonce in the tf_duplicate_post_data handler according to tourfic-admin-scripts.min.js).

6. Test Data Setup

  1. Plugin Installation: Install and activate Tourfic <= 2.22.5.
  2. User Creation: Create a user with the customer role:
    wp user create attacker attacker@example.com --role=customer --user_pass=password123
  3. 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. If tf_generate_api_key is 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

  1. 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)
  2. 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" and order_unique_id=1. This would impact the business logic of car rentals or hotel check-ins.
  • Parameter Fuzzing: If the name parameter in tf_generate_api_key is actually passed into a SQL query without sanitization (unlikely but possible), this could lead to SQL Injection. Use the http_request tool to test ' in the name field.
Research Findings
Static analysis — not yet PoC-verified

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

--- a/inc/admin/functions.php
+++ b/inc/admin/functions.php
@@ -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.