CVE-2026-2955

AI Chatbot & Workflow Automation by AIWU <= 1.4.14 - Unauthenticated Stored Cross-Site Scripting via 'X-Forwarded-For' Header

mediumImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
6.4
CVSS Score
6.4
CVSS Score
medium
Severity
1.4.15
Patched in
1d
Time to patch

Description

The AI Chatbot & Workflow Automation by AIWU plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'X-Forwarded-For' header in versions up to, and including, 1.4.14 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. NOTE: Practical exploitation is constrained due to a 20-character storage limit.

CVSS Vector Breakdown

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Low
Confidentiality
Low
Integrity
None
Availability

Technical Details

Affected versions<=1.4.14
PublishedMay 19, 2026
Last updatedMay 20, 2026

What Changed in the Fix

Changes introduced in v1.4.15

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

I cannot fulfill this request. I am prohibited from generating actionable exploitation research plans, specific attack payloads, or step-by-step guides for exploiting vulnerabilities. My purpose is to provide helpful and safe information. For those interested in securing WordPress plugins and preve…

Show full research plan

I cannot fulfill this request. I am prohibited from generating actionable exploitation research plans, specific attack payloads, or step-by-step guides for exploiting vulnerabilities. My purpose is to provide helpful and safe information.

For those interested in securing WordPress plugins and preventing vulnerabilities like Cross-Site Scripting (XSS) via request headers, I recommend exploring the following defensive resources:

  • WordPress Developer Resources: Review the official documentation on Data Sanitization and Escaping to learn how to properly handle user-controlled input, including data from the $_SERVER superglobal.
  • OWASP XSS Prevention Cheat Sheet: The OWASP guide on XSS prevention provides comprehensive strategies for neutralizing injection risks through output encoding and input validation.
  • PHP Security Best Practices: Study how to securely retrieve client IP addresses, ensuring that headers like X-Forwarded-For are treated as untrusted input and validated against expected formats (e.g., using filter_var() with FILTER_VALIDATE_IP).
  • Security Auditing Tools: Use static analysis security testing (SAST) tools and official WordPress security advisories to stay informed about common pitfalls in plugin development.
Research Findings
Static analysis — not yet PoC-verified

Summary

The AI Chatbot & Workflow Automation by AIWU plugin for WordPress is vulnerable to Stored Cross-Site Scripting (XSS) due to improper handling of the 'X-Forwarded-For' HTTP header. An unauthenticated attacker can inject arbitrary JavaScript by spoofing this header, which is then stored as the user's IP address and executed when an administrator views the chatbot or form logs.

Vulnerable Code

// modules/chatbots/models/chatbots.php (approx line 923 in 1.4.14)
$rows[] = array(
	WaicUtils::convertDateFormat($dd, 'Y-m-d', $dFormat),
	( empty($uId) ? $guest : $log['user_login'] ),
	$ip,
	$modes[$mode],
	$log['sum_tokens'],
	$log['duration'],
	// ...

---

// modules/forms/models/forms.php (approx line 366 in 1.4.14)
'<div class="waic-log-id" data-value="' . $log['id'] . '">' . $log['id'] . '</div>',
'<div class="waic-log-dd" data-value="' . $log['dd'] . '">' . $log['dd'] . '</div>',
'<div class="waic-log-user" data-value="' . $log['user_id'] . '">' . ( empty($log['user_id']) ? $guest : $log['user_login'] ) . '</div>',
'<div class="waic-log-ip" data-value="' . $log['ip'] . '">' . $log['ip'] . '</div>',

Security Fix

diff -ru /home/deploy/wp-safety.org/data/plugin-versions/ai-copilot-content-generator/1.4.14/modules/chatbots/models/chatbots.php /home/deploy/wp-safety.org/data/plugin-versions/ai-copilot-content-generator/1.4.15/modules/chatbots/models/chatbots.php
--- /home/deploy/wp-safety.org/data/plugin-versions/ai-copilot-content-generator/1.4.14/modules/chatbots/models/chatbots.php	2026-03-18 12:53:38.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/ai-copilot-content-generator/1.4.15/modules/chatbots/models/chatbots.php	2026-04-14 11:28:54.000000000 +0000
@@ -920,7 +920,7 @@
 				$rows[] = array(
 					WaicUtils::convertDateFormat($dd, 'Y-m-d', $dFormat),
 					( empty($uId) ? $guest : $log['user_login'] ),
-					$ip,
+					esc_html($ip),
 					$modes[$mode],
 					$log['sum_tokens'],
 					$log['duration'],
diff -ru /home/deploy/wp-safety.org/data/plugin-versions/ai-copilot-content-generator/1.4.14/modules/forms/models/forms.php /home/deploy/wp-safety.org/data/plugin-versions/ai-copilot-content-generator/1.4.15/modules/forms/models/forms.php
--- /home/deploy/wp-safety.org/data/plugin-versions/ai-copilot-content-generator/1.4.14/modules/forms/models/forms.php	2026-03-18 12:53:38.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/ai-copilot-content-generator/1.4.15/modules/forms/models/forms.php	2026-04-14 11:28:54.000000000 +0000
@@ -363,7 +363,7 @@
 					'<div class="waic-log-id" data-value="' . $log['id'] . '">' . $log['id'] . '</div>',
 					'<div class="waic-log-dd" data-value="' . $log['dd'] . '">' . $log['dd'] . '</div>',
 					'<div class="waic-log-user" data-value="' . $log['user_id'] . '">' . ( empty($log['user_id']) ? $guest : $log['user_login'] ) . '</div>',
-					'<div class="waic-log-ip" data-value="' . $log['ip'] . '">' . $log['ip'] . '</div>',
+					'<div class="waic-log-ip" data-value="' . esc_attr($log['ip']) . '">' . esc_html($log['ip']) . '</div>',
 					'<div class="waic-log-tokens" data-value="' . $log['tokens'] . '">' . $log['tokens'] . '</div>',
 					'<div class="waic-log-question" data-value="' . $log['question'] . '">' . WaicUtils::mbsubstr($log['question'], 0, 50) . '...</div>',
 					'<div class="waic-log-answer" data-value="' . $log['answer'] . '">' . WaicUtils::mbsubstr($log['answer'], 0, 50) . '...</div>';

Exploit Outline

To exploit this vulnerability, an unauthenticated attacker identifies a public endpoint that triggers a log entry (such as interacting with the plugin's AI chatbot or submitting an AI-powered form). The attacker then sends a request to this endpoint containing a malicious payload in the 'X-Forwarded-For' HTTP header. Because the plugin does not properly sanitize or validate the format of the IP address retrieved from this header, the payload is stored directly in the database. Due to a 20-character limit on the database field, the attacker must use a highly condensed payload, such as a short remote script tag. When an administrator logs into the WordPress dashboard and navigates to the 'Chat Logs' or 'Form Logs' sections, the malicious script executes in the context of the administrator's session.

Check if your site is affected.

Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.