Stored XSS via unescaped Template Part tagName
Published Jun 25, 2024 · Updated Apr 28, 2026
Stored XSS in the Template Part block in Automattic WordPress 5.9 through 6.5.4 allows remote authenticated users to inject scripts. The block renderer accepts an insufficiently sanitized tagName attribute and emits it as the Template Part wrapper tag without adequate output escaping. Contributor-level access is required to store the payload, and script execution occurs when another user visits the affected page.
Summary
What happened
Stored XSS in the Template Part block in Automattic WordPress 5.9 through 6.5.4 allows remote authenticated users to inject scripts. The block renderer accepts an insufficiently sanitized tagName attribute and emits it as the Template Part wrapper tag without adequate output escaping. Contributor-level access is required to store the payload, and script execution occurs when another user visits the affected page.
The record
- CVE
- CVE-2024-31111
- Published
- Jun 25, 2024
- Updated
- Apr 28, 2026
- Vendor
- Automattic
- Product
- WordPress
- Classifications
- CWE-79, CAPEC-592, T1059.007
- Attack vector
- network
- Privileges
- authenticated
Timeline
How it unfolded
- Jun 25, 2024CVE publishedPublication date reported by the CVE source.
- Apr 28, 2026Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=5.9 <=5.9.9 changes=[{"at":"5.9.10","status":"unaffected"}]
- Affected versionversion=6.0 <=6.0.8 changes=[{"at":"6.0.9","status":"unaffected"}]
- Affected versionversion=6.1 <=6.1.6 changes=[{"at":"6.1.7","status":"unaffected"}]
- Affected versionversion=6.2 <=6.2.5 changes=[{"at":"6.2.6","status":"unaffected"}]
- Affected versionversion=6.3 <=6.3.4 changes=[{"at":"6.3.5","status":"unaffected"}]
- Affected versionversion=6.4 <=6.4.4 changes=[{"at":"6.4.5","status":"unaffected"}]
- Affected versionversion=6.5 <=6.5.4 changes=[{"at":"6.5.5","status":"unaffected"}]
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
No public exploit references are available in this record.
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo