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 CoreWordPress 6.9
Affected Version6.8 – 6.9.1 · 2 branches
CVSS4.4Medium
CVEN/A
View all WordPress 6.9 vulnerabilities

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

REMEDIATION: Update to one of the following versions, or a newer patched version: 6.8.4, 6.9.2 --- IDENTIFIER: CWE-79 (Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

External References

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