WordPress <= 6.9.1 - Cross-Site Scripting via Client-Side Template Override in Admin Area

2026-03-10 00:00
Asaf Mozes

Strategic Overview

Status
Patched in 6.8.4
Affected Core
WordPress 6.9
Affected Version
6.8 – 6.9.1 · 2 branches
CVSS
4.4Medium
Weakness type
CWE-79 · Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
CVE
CVE pending
View all WordPress 6.9 vulnerabilities

At a glance

This record tracks a medium-severity Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerability in the WordPress 6.9 WordPress release line, affecting 6.8 – 6.9.1 · 2 branches. It carries a CVSS score of 4.4 (reachable over the network). The issue is fixed in version 6.8.4; sites on affected versions should update now. Disclosed March 2026, reported by Asaf Mozes.

Vulnerability Overview

WordPress core is vulnerable to Cross-Site Scripting via client-side template overriding in the admin area in all versions up to and including 6.9.1. The `wp.template()` JavaScript function uses `document.getElementById()` to locate templates, which matches any HTML element by ID regardless of element type. WordPress admin templates are intended to be `<script type="text/html" id="tmpl-*">` elements, but `getElementById` also matches `<div>`, `<img>`, and other injected elements. If an attacker can inject a non-script element with a matching `tmpl-*` ID, the template content is overridden with attacker-controlled HTML, which is then compiled by Underscore.js `_.template()` with JavaScript execution support. This is a conditional vulnerability that requires an existing HTML injection vector in the admin context.

Technical Analysis

The vector marks this flaw as remotely reachable over the network.

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

WordPress 6.9 6.8 – 6.9.1 · 2 branches carries this weakness at template(), 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 WordPress 6.9 the fix is 6.8.4: builds 6.8 – 6.9.1 · 2 branches are affected, anything from 6.8.4 onward is not.

Remediation

Update to one of the following versions, or a newer patched version: 6.8.4, 6.9.2

How does WordSec protect against this?

The attempt arrives as an ordinary request to WordPress 6.9: WordSec's web application firewall inspects request payloads before WordPress loads them. None of that substitutes for the fix: updating to 6.8.4 is the step that ends it.

  • Firewall
  • Alerts

External References

Related records

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