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

Medium 6.1 Published Updated

Attackers can execute arbitrary JavaScript in victim browsers via the Referer header if the search-query tag is used, potentially compromising admin accounts.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2026-19902?

CVE-2026-19902 is a medium-severity cross-site scripting vulnerability in spacetime Ad Inserter – Ad Manager & AdSense Ads, published on 1 Oct 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

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.

Weakness: CWE-79

Which versions are affected by CVE-2026-19902?

How do I fix CVE-2026-19902?

No fix has been published for CVE-2026-19902 yet. Limit exposure of the affected software until one is available.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-19902 being exploited?

There is no known exploitation of CVE-2026-19902 in the wild and no public exploit code.

Sources

Also known as GHSA-298r-885r-pj27.

Is CVE-2026-19902 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free