CVE-2026-12157
Deferred Deferred - Pending Action

Stored XSS in BetterDocs WordPress Plugin via CategorySlateLayout

Vulnerability report for CVE-2026-12157, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-06-19

Last updated on: 2026-06-22

Assigner: Wordfence

Description

The BetterDocs - Knowledge Base Docs & FAQ Solution for Elementor & Block Editor plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the blockId attribute of the betterdocs/category-slate-layout Gutenberg block in versions up to, and including, 4.5.3. This is due to insufficient input sanitization and output escaping in the CategorySlateLayout::render() method, which echoes the blockId block attribute directly into an HTML class attribute without esc_attr(). This makes it possible for authenticated attackers, with contributor-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-06-19
Last Modified
2026-06-22
Generated
2026-07-09
AI Q&A
2026-06-19
EPSS Evaluated
2026-07-08
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
betterdocs betterdocs to 4.5.3 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-79 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.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Detection Guidance

This vulnerability involves the BetterDocs WordPress plugin versions up to 4.5.3, where the blockId attribute in the betterdocs/category-slate-layout Gutenberg block is vulnerable to stored cross-site scripting due to insufficient sanitization.

To detect this vulnerability on your system, you should check the installed version of the BetterDocs plugin to see if it is version 4.5.3 or earlier.

You can use the following command on your WordPress installation to check the plugin version:

  • grep -i 'betterdocs' wp-content/plugins/betterdocs/readme.txt

Alternatively, you can check the plugin version via the WordPress admin dashboard under Plugins.

To detect if any pages have been injected with malicious scripts via this vulnerability, you can search your WordPress database for suspicious script tags or unusual content in posts or pages that use the betterdocs/category-slate-layout block.

  • Use a database query like: SELECT post_content FROM wp_posts WHERE post_content LIKE '%<script%' AND post_content LIKE '%betterdocs/category-slate-layout%';
Executive Summary

The BetterDocs - Knowledge Base Docs & FAQ Solution plugin for WordPress is vulnerable to Stored Cross-Site Scripting (XSS) via the blockId attribute of the betterdocs/category-slate-layout Gutenberg block in versions up to and including 4.5.3.

This vulnerability exists because the plugin does not properly sanitize or escape input in the CategorySlateLayout::render() method, which directly outputs the blockId attribute into an HTML class attribute without using esc_attr().

As a result, authenticated users with contributor-level access or higher can inject arbitrary web scripts into pages, which will execute whenever any user accesses the injected page.

Impact Analysis

This vulnerability allows attackers with contributor-level access or above to inject malicious scripts into pages.

These scripts can execute in the browsers of users who visit the affected pages, potentially leading to theft of user data, session hijacking, or other malicious activities.

Because the vulnerability is a Stored Cross-Site Scripting issue, the injected scripts persist on the site and affect all users who view the compromised content.

Mitigation Strategies

The immediate mitigation step is to update the BetterDocs plugin to a version later than 4.5.3 where this vulnerability is fixed.

If updating immediately is not possible, restrict contributor-level and higher user permissions temporarily to trusted users only, as the vulnerability requires authenticated contributor-level access or above.

Additionally, review and sanitize any content created by contributors that uses the betterdocs/category-slate-layout block to remove any injected scripts.

Consider implementing a Web Application Firewall (WAF) rule to block suspicious script injections targeting this plugin.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-12157. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart