CVE-2026-19902

Ad Inserter <= 2.8.18 - Reflected Cross-Site Scripting via {search-query} Dynamic Tag (Referer Header)

2026-09-30 19:33
Yuto Hyakumoto

Strategic Overview

Status
Patched in 2.8.19
Affected Version
<= 2.8.18
CVSS
6.1Medium
Weakness type
CWE-79 · Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
CVE
CVE-2026-19902
View all Ad Inserter – Ad Manager & AdSense Ads vulnerabilities

At a glance

CVE-2026-19902 is a medium-severity Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in the Ad Inserter WordPress plugin, affecting versions <= 2.8.18. It carries a CVSS score of 6.1 (reachable over the network; low attack complexity). Exploitation requires no authentication. The issue is fixed in version 2.8.19; sites on affected versions should update now. Disclosed September 2026, reported by Yuto Hyakumoto.

Vulnerability Overview

The Ad Inserter – Ad Manager & AdSense Ads plugin for WordPress is vulnerable to Reflected Cross-Site Scripting via the Referer header in all versions up to, and including, 2.8.18 due to insufficient input sanitization and output escaping on the '{search-query}' dynamic tag. When an ad block's code contains that tag, replace_ai_tags() reads $_SERVER['HTTP_REFERER'] and tests it with the regex /[\.\/](google|yahoo|bing|ask)\.[a-z\.]{2,5}[\/]/i. The leading [\.\/] class matches a literal slash, so any referrer merely containing a segment such as '/google.com/' passes as a search-engine referral; the plugin then percent-decodes the referring query with parse_str() and substitutes the resulting 'q' (or 'p') value into the block via preg_replace() with no escaping. This makes it possible for unauthenticated attackers to execute arbitrary JavaScript in the context of the site for any visitor, including a signed-in administrator, by luring them to an attacker-controlled page that frames or links to any ordinary post. Exploitation requires the site to have an ad block whose code uses the '{search-query}' tag with automatic insertion enabled — a documented plugin feature used as intended.

Technical Analysis

The vector marks this flaw as remotely reachable over the network, with low attack complexity — no special timing or configuration is needed, and no privileges on the target site.

CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Ad Inserter <= 2.8.18 carries this weakness at HTTP_REFERER, and reaching it takes a caller who can reach the endpoint. Cross-site scripting happens when input from a request is written into a page without being escaped for the context it lands in, so the browser parses attacker-supplied text as markup or script.

Injected script runs with the privileges of whoever views the affected page, which is how these flaws turn into administrator session theft, silent account creation or persistent backdoors in page content. For Ad Inserter the fix is 2.8.19: builds <= 2.8.18 are affected, anything from 2.8.19 onward is not.

Remediation

Update to version 2.8.19, or a newer patched version

How does WordSec protect against this?

The attempt arrives as an ordinary request to Ad Inserter: WordSec's web application firewall inspects request payloads before WordPress loads them. None of that substitutes for the fix: Ad Inserter 2.8.19 closes this, and updating the plugin is the step that ends it.

  • Firewall
  • Alerts

External References

Related records

Vulnerability data © Defiant, Inc., provided under the Wordfence Intelligence T&C