Plugin Directory

Changeset 3378505


Ignore:
Timestamp:
10/15/2025 12:41:50 AM (4 months ago)
Author:
mxchat
Message:

2.4.7 fixes security vulnerability from the PDF upload.

Location:
mxchat-basic
Files:
103 added
6 edited

Legend:

Unmodified
Added
Removed
  • mxchat-basic/trunk/css/chat-style.css

    r3370326 r3378505  
    971971}
    972972
     973.chatbot-top-bar#exit-chat-button button.exit-chat:hover {
     974    background: none;
     975}
    973976.visible {
    974977    display: flex;
  • mxchat-basic/trunk/includes/class-mxchat-addons.php

    r3372373 r3378505  
    191191     */
    192192    public function enqueue_styles() {
    193         $plugin_version = '2.4.6';
     193        $plugin_version = '2.4.7';
    194194
    195195        wp_enqueue_style(
  • mxchat-basic/trunk/includes/class-mxchat-admin.php

    r3372373 r3378505  
    65316531public function mxchat_enqueue_admin_assets() {
    65326532    // Get plugin version (define this in your main plugin file)
    6533     $version = defined('MXCHAT_VERSION') ? MXCHAT_VERSION : '2.4.6';
     6533    $version = defined('MXCHAT_VERSION') ? MXCHAT_VERSION : '2.4.7';
    65346534
    65356535    // Use file modification time for development (remove in production)
  • mxchat-basic/trunk/includes/class-mxchat-integrator.php

    r3372373 r3378505  
    18671867   
    18681868    if (false === $results) {
    1869         // Fetch new results from the Brave Search API
    1870         $response = wp_remote_get(
     1869        // SECURITY FIX: Changed to wp_safe_remote_get
     1870        $response = wp_safe_remote_get(
    18711871            $api_url,
    18721872            array(
     
    20092009        ];
    20102010
    2011         $response = wp_remote_get($api_url, $args);
     2011        // SECURITY FIX: Changed to wp_safe_remote_get
     2012        $response = wp_safe_remote_get($api_url, $args);
    20122013
    20132014        if (is_wp_error($response)) {
     
    24092410
    24102411/**
    2411  * Enhanced fetch_and_split_pdf_pages with detailed debugging
     2412 * Enhanced fetch_and_split_pdf_pages with SSRF protection
    24122413 */
    24132414private function fetch_and_split_pdf_pages($pdf_source, $max_pages) {
     
    24662467        if (filter_var($pdf_source, FILTER_VALIDATE_URL)) {
    24672468            //error_log("Downloading PDF from URL...");
     2469           
     2470            // SECURITY FIX: Validate URL before processing
     2471            if (!$this->mxchat_is_safe_pdf_url($pdf_source)) {
     2472                //error_log("❌ SECURITY: Blocked unsafe PDF URL");
     2473                return false;
     2474            }
     2475           
    24682476            $temp_file = wp_tempnam($pdf_source);
    2469             $response = wp_remote_get($pdf_source, [
     2477           
     2478            // SECURITY FIX: Changed from wp_remote_get to wp_safe_remote_get
     2479            $response = wp_safe_remote_get($pdf_source, [
    24702480                'timeout' => 60,
    24712481                'headers' => ['User-Agent' => 'MxChat PDF Processor']
     
    25502560    }
    25512561}
     2562
     2563
     2564/**
     2565 * Validate PDF URL for security
     2566 * Prevents SSRF attacks by blocking dangerous URLs
     2567 */
     2568 
     2569private function mxchat_is_safe_pdf_url($url) {
     2570    // Use WordPress core function for comprehensive validation
     2571    // This blocks localhost, private IPs, and reserved IP ranges
     2572    $validated_url = wp_http_validate_url($url);
     2573   
     2574    if ($validated_url === false) {
     2575        return false;
     2576    }
     2577   
     2578    // Additional check: only allow HTTP/HTTPS schemes
     2579    $parsed = parse_url($url);
     2580    if (!isset($parsed['scheme']) || !in_array($parsed['scheme'], ['http', 'https'], true)) {
     2581        return false;
     2582    }
     2583   
     2584    return true;
     2585}
     2586
    25522587
    25532588private function mxchat_clean_text($text) {
     
    63396374public function mxchat_enqueue_scripts_styles() {
    63406375    // Define version numbers for the styles and scripts
    6341     $chat_style_version = '2.4.6';
    6342     $chat_script_version = '2.4.6';
     6376    $chat_style_version = '2.4.7';
     6377    $chat_script_version = '2.4.7';
    63436378    // Enqueue the script
    63446379    wp_enqueue_script(
  • mxchat-basic/trunk/mxchat-basic.php

    r3372373 r3378505  
    44 * Plugin URI: https://mxchat.ai/
    55 * Description: AI chatbot for WordPress with OpenAI, Claude, xAI, DeepSeek, live agent, PDF uploads, WooCommerce, and training on website data.
    6  * Version: 2.4.6
     6 * Version: 2.4.7
    77 * Author: MxChat
    88 * Author URI: https://mxchat.ai
     
    1818
    1919// Define plugin version constant for asset versioning
    20 define('MXCHAT_VERSION', '2.4.6');
     20define('MXCHAT_VERSION', '2.4.7');
    2121
    2222function mxchat_load_textdomain() {
  • mxchat-basic/trunk/readme.txt

    r3372373 r3378505  
    66Tested up to: 6.8
    77Requires PHP: 7.2
    8 Stable tag: 2.4.6
     8Stable tag: 2.4.7
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    182182== Changelog ==
    183183
    184 = 2.4.6 - October, 3, 2025 =
    185 - Update: Added plugin URI information.
     184= 2.4.7 - October 13, 2025 =
     185- Security: Fixed Server-Side Request Forgery (SSRF) vulnerability in PDF processing (CVE-2025-10705)
    186186
    187187= 2.4.5 - September 30, 2025 =
     
    556556== Upgrade Notice ==
    557557
    558 = 2.4.6 =
    559 - Update: Added plugin URI information.
     558= 2.4.7 =
     559- Security: Fixed Server-Side Request Forgery (SSRF) vulnerability in PDF processing (CVE-2025-10705)
    560560
    561561== License & Warranty ==
Note: See TracChangeset for help on using the changeset viewer.