Summary
A Stored Cross-Site Scripting (XSS) vulnerability exists in the WPForms plugin. This affects WPForms – AI Form Builder for WordPress – Contact Forms, Payment Forms, Survey Form, Quiz & More, versions 2.0.4 and earlier. A patch is available in version 2.0.5.1. There is no evidence of active exploitation.
Affected and patched versions
WPForms – AI Form Builder for WordPress – Contact Forms, Payment Forms, Survey Form, Quiz & More (plugin wpforms-lite): affected 2.0.4 and earlier; fixed in 2.0.5.1
Is my site vulnerable?
To determine if a site is vulnerable to CVE-2026-126342, check the installed version of the WPForms plugin. Access the WordPress administration dashboard. Navigate to the 'Plugins' section and select 'Installed Plugins'. Locate "WPForms – AI Form Builder for WordPress – Contact Forms, Payment Forms, Survey Form, Quiz & More" in the list. The version number is displayed next to the plugin name.
If the installed version is 2.0.4 or any earlier version, the site is vulnerable to this issue. Sites running version 2.0.5.1 or a newer patched version are not vulnerable to CVE-2026-126342. Confirm the exact version number displayed in the plugin list to assess the site's status regarding this vulnerability.
What an attacker actually does
The vulnerability allows an unauthenticated attacker to inject malicious web scripts into payment forms. This injection occurs through the 'Other' option within a Multiple Choice field on payment forms. When an attacker submits a payment form containing this crafted input, the malicious script is stored within the website's database.
The core of this issue lies in how the WPForms plugin processes and displays user-submitted data. Specifically, the plugin uses sanitize_text_field() to store the submitted value. This function, however, does not fully remove certain pseudo-tags if they contain whitespace after the opening angle bracket. An attacker can craft a specific input, such as a pseudo-tag like < i class="wpforms-single-payment-tooltip" data-tooltip-content="<img src=x onerror=...>">x< /i>, which sanitize_text_field() preserves during storage.
Later, when a privileged user, such as an administrator, views the affected payment entry on the WPForms > Payments details page, the stored value is retrieved. The plugin then outputs this value using wp_kses() with the 'post' allowlist. This process normalizes the pseudo-tag into a live <i> HTML element, retaining its class and data-* attributes. Crucially, the WPForms plugin includes Tooltipster initialization, which is configured to render the content of the data-tooltip-content attribute as HTML. This setup causes the injected script, embedded within the data-tooltip-content attribute, to execute automatically on page load, without requiring any user interaction like hovering. The execution of this script in the context of an administrator's browser can lead to various malicious outcomes, including session hijacking, unauthorized administrative actions, or redirection to malicious sites.
How to detect a compromise
Detecting a compromise related to this vulnerability involves examining stored form entry data for malicious scripts. The vulnerability specifically targets the 'Other' option value within Multiple Choice fields on payment forms.
Administrators should review payment entries within the WPForms > Payments details page for any unusual content in the 'Other' fields. Look for text that appears to be HTML code, especially elements containing data-tooltip-content attributes with embedded scripts or unexpected characters. While visual inspection can identify obvious anomalies, a more thorough check requires direct examination of the database.
The malicious payload is stored in the database. The specific structure to search for includes pseudo-tags that become live <i> elements with data-tooltip-content attributes. A common pattern for the injected script is < i class="wpforms-single-payment-tooltip" data-tooltip-content="<img src=x onerror=...>">x< /i>. This indicates that the data-tooltip-content attribute holds the executable script.
To perform a database search, you can use a tool like phpMyAdmin or a command-line interface with a MySQL/MariaDB client. The exact table and column where WPForms stores entry data can vary, but it is typically found within the wp_postmeta table, associated with form entry post types, or potentially directly in a custom table created by WPForms for entries.
A general SQL query to search for such patterns might look like this, assuming wp_postmeta stores the relevant data and meta_value contains the form field data:
SELECT * FROM wp_postmeta WHERE meta_value LIKE '%data-tooltip-content="<img src=x onerror=%' OR meta_value LIKE '%<i class="wpforms-single-payment-tooltip" data-tooltip-content=%';This query searches for the specific data-tooltip-content attribute pattern that triggers the script execution. If any results are returned, further investigation of those specific entries is warranted.
For WordPress installations with WP-CLI access, it may be possible to query form entries directly, though the exact command depends on how WPForms structures its data for WP-CLI access. A general approach might involve listing form entries and then inspecting their metadata. For example, if WPForms entries are custom post types, you could use:
wp post list --post_type=wpforms_entry --fields=ID,post_content --format=json | jq '.[] | select(.post_content | contains("data-tooltip-content=\"<img src=x onerror="))'This command assumes wpforms_entry is the post type and the content is in post_content. Adjustments may be necessary based on the actual data storage method. The key is to look for the data-tooltip-content attribute containing encoded HTML or script tags within the stored form entry data.
Any entries found containing these patterns should be considered compromised. The malicious script will execute whenever an administrator views that specific payment entry.
How to fix
Access the WordPress administration dashboard.
Navigate to the 'Plugins' section and select 'Installed Plugins'.
Locate "WPForms – AI Form Builder for WordPress – Contact Forms, Payment Forms, Survey Form, Quiz & More" in the list.
Update the plugin to version 2.0.5.1 or a newer patched version. This update addresses the insufficient input sanitization and output escaping that causes the vulnerability.
Timeline
Date | Event |
|---|---|
2026-11-17 | Reported |
2026-11-19 | Patch Release |
2026-11-26 | NVD Publication |
2026-11-26 | Dr. Web Report |