Skip to main content
Vulnerability Database/CVE-2026-97640

CVE-2026-97640: WPConsent WordPress Plugin XSS Vulnerability

CVE-2026-97640 is a stored XSS vulnerability in WPConsent WordPress plugin affecting versions up to 1.1.9. Attackers can inject malicious scripts via comment content exploitation. This article covers technical details, impact, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-97640 Overview

CVE-2026-97640 is a stored Cross-Site Scripting (XSS) vulnerability [CWE-79] affecting the WPConsent – Cookie Banner & Cookie Consent plugin for WordPress. All versions up to and including 1.1.9 are vulnerable due to insufficient input sanitization and output escaping in the plugin's bundled Simple HTML DOM parser. Unauthenticated attackers can inject arbitrary web scripts that execute when any user visits an affected page. The flaw requires the plugin's Script Blocking feature to be enabled on the target site.

Critical Impact

Unauthenticated attackers can achieve stored script execution on WordPress pages by chaining two crafted comments that abuse the deterministic ___noise___ restoration key in the plugin's HTML parser.

Affected Products

  • WPConsent – Cookie Banner & Cookie Consent for Privacy Compliance plugin for WordPress
  • All versions up to and including 1.1.9
  • Deployments with the Script Blocking feature enabled

Discovery Timeline

  • 2026-10-16 - CVE-2026-97640 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-97640

Vulnerability Analysis

The vulnerability is a mutation-based Cross-Site Scripting (mXSS) flaw in the plugin's bundled class-wpconsent-simple-html-dom.php parser. When the Script Blocking feature processes page content, the parser replaces specific noisy constructs with deterministic placeholder tokens using a ___noise___ prefix, then restores the original content after sanitization. Because the restoration step reinserts previously extracted strings without re-applying output escaping, an attacker can smuggle executable event-handler syntax past the plugin's allow-list of HTML elements. The result is stored script execution in any browser rendering the affected comment thread.

Root Cause

The root cause is unsafe round-tripping of untrusted content in the Simple HTML DOM parser's noise-handling routine. The parser extracts certain substrings, assigns them deterministic restoration keys, and later swaps the keys back for the original payloads. Sanitization is applied to the intermediate representation rather than the final rendered output, so attacker-controlled strings bypass escaping. Allowed elements such as <code> and <abbr title=""> provide the surface for injecting both the handler syntax and the restoration key.

Attack Vector

Exploitation is network-based and requires no authentication or user interaction beyond a victim visiting the affected page. An attacker submits two coordinated comments: one embeds event-handler syntax inside an allowed <code> element, and the other places the deterministic ___noise___ restoration key inside an allowed <abbr title=""> attribute. The attacker confirms the correct key offset by issuing an unauthenticated wpconsent_debug=1 request. When the parser restores the noise token, the two fragments merge into an executing script context. Full technical analysis is available in the Wordfence Vulnerability Analysis.

Detection Methods for CVE-2026-97640

Indicators of Compromise

  • Comment submissions containing the literal string ___noise___ or similar deterministic placeholder tokens.
  • Unauthenticated HTTP requests containing the wpconsent_debug=1 query parameter from external IPs.
  • Comments containing <abbr title="..."> attributes with unusual payloads paired with <code> elements containing event-handler syntax such as onerror= or onclick=.
  • Outbound requests from site visitors to attacker-controlled domains originating from pages hosting user comments.

Detection Strategies

  • Inspect WordPress wp_comments table rows for <abbr> and <code> tags co-occurring with noise-key markers.
  • Monitor web server access logs for repeated probes against endpoints carrying wpconsent_debug=1.
  • Deploy web application firewall rules that flag or block comment bodies containing ___noise___ substrings.

Monitoring Recommendations

  • Alert on new or modified comments posted by unauthenticated users containing HTML parser control tokens.
  • Track browser-side script errors and Content Security Policy violations originating from comment-rendering pages.
  • Review plugin audit logs for Script Blocking feature state changes and configuration modifications.

How to Mitigate CVE-2026-97640

Immediate Actions Required

  • Update the WPConsent plugin to a version later than 1.1.9 that includes the fix referenced in WordPress Changeset 3734401.
  • Audit existing comments on affected sites for payloads containing ___noise___ tokens and remove them.
  • Disable the Script Blocking feature until the patched version is deployed if an immediate update is not possible.

Patch Information

The vendor addressed the flaw in the Simple HTML DOM parser. Review the WordPress Changeset Comparison for the complete diff between the vulnerable baseline and the fixed release. Site administrators should upgrade through the WordPress plugin updater or by replacing the plugin files directly.

Workarounds

  • Temporarily disable the WPConsent Script Blocking feature in the plugin settings.
  • Restrict comment submission to authenticated users and require moderation for first-time commenters.
  • Deploy a WAF rule that strips or rejects comment bodies containing the ___noise___ substring and suspicious <abbr title> payloads.
bash
# Example WAF rule concept (ModSecurity-style) to block the noise-key marker in POST bodies
SecRule REQUEST_METHOD "@streq POST" \
  "chain,phase:2,deny,status:403,id:1026097640,msg:'WPConsent mXSS noise-key payload (CVE-2026-97640)'"
  SecRule REQUEST_BODY "@contains ___noise___" "t:none,t:lowercase"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.