Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconObtain contributor-level WordPress account
-
DeliveryCraft heading with entity-encoded XSS payload in id attribute
-
ExploitSubmit post bypassing wp_kses_post sanitization
-
InstallVictim visits injected documentation page
-
C2process_content_for_toc() calls html_entity_decode() on stored content
-
ExecuteLazy regex extracts unescaped id value
-
ImpactArbitrary JavaScript executes in victim browser
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the attacker to hold a valid WordPress account with at minimum contributor-level role on the target site - anonymous or subscriber-level users cannot create or publish posts and are not a valid attack vector. The vulnerable code path is only triggered when the BetterDocs Table of Contents shortcode (process_content_for_toc() in ToC.php) processes a post or documentation page containing a heading element whose id attribute carries entity-encoded JavaScript. A victim user must subsequently visit the page containing the injected content for the payload to execute. Limiting factors are: (1) contributor or higher WordPress role is mandatory for post creation; (2) the BetterDocs plugin must be installed, active, and configured to render the ToC shortcode on the affected page type; (3) victim page visit is required for execution - the payload does not propagate automatically. Sites that do not provision contributor accounts to untrusted parties are not exposed to this attack path. |
| Impact | The CVSS 6.4 Medium score reflects Scope:Changed (XSS payload executes in the victim browser context outside the plugin) with the PR:L prerequisite for a valid contributor account moderating overall severity. In multi-author WordPress environments where contributor accounts are routinely provisioned to content editors or external writers, this risk is non-trivial: injected pages persist silently until the stored content is audited and remediated. No EPSS data was provided, and the CVE has not been added to the CISA KEV catalog, indicating no confirmed active exploitation at time of analysis. The technical sophistication of the bypass - entity-encoding to survive wp_kses_post, then html_entity_decode exposure inside the ToC pipeline - suggests discovery through deliberate security research by Wordfence rather than organic attacker discovery, which mildly reduces near-term weaponization probability. However, the Wordfence public disclosure now provides sufficient implementation detail and source code references for independent reproduction by a capable attacker, so deferring remediation on actively-edited sites is inadvisable. |
| Exploit ScenarioDerived | An attacker with a contributor-level WordPress account crafts a BetterDocs documentation page whose heading contains an id attribute with entity-encoded JavaScript (for example, encoded event handlers or URI-based payloads) that passes wp_kses_post validation and is stored in the database. When any visitor later loads that page, the BetterDocs ToC shortcode calls html_entity_decode() on the stored heading, a lazy regex extracts the unescaped id, and the payload is echoed unescaped into the rendered Table of Contents HTML - executing attacker-controlled JavaScript in the victim's browser and enabling session hijacking, credential harvesting, or malicious redirection. No public proof-of-concept has been confirmed, though the Wordfence disclosure references exact source file lines sufficient for independent reproduction. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 01, 2026
Stored cross-site scripting in the BetterDocs WordPress plugin (versions through 4.8.1) allows contributor-level authenticated attackers to inject persistent JavaScript that executes in any visitor's browser context. The flaw exploits a two-stage processing gap: entity-encoded quotes in a heading id attribute pass WordPress's wp_kses_post sanitization at save time, but are later decoded by html_entity_decode() inside process_content_for_toc(), after which a lazy regex extracts the now-unescaped value and echoes it directly into the Table of Contents HTML output. No public exploit code or active exploitation (CISA KEV) has been identified at time of analysis.
RemediationAI
A code change has been committed to the WordPress plugin SVN repository (changeset 3656697 at https://plugins.trac.wordpress.org/changeset?reponame=&old=3656697%40betterdocs&new=3656697%40betterdocs), indicating upstream fixes are available; however, an exact patched release version number is not independently confirmed from the supplied references - administrators should upgrade to the latest available version above 4.8.1 from the WordPress plugin directory and verify the fix against the Wordfence advisory. As a targeted compensating control prior to patching, disabling the BetterDocs Table of Contents shortcode feature eliminates the vulnerable process_content_for_toc() code path entirely, with the trade-off of losing ToC rendering site-wide. Restricting contributor-level account provisioning on multi-author sites reduces the attacker pool. Auditing existing documentation posts for heading id attributes containing encoded or anomalous characters is advisable to detect any pre-existing injection.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The affected component is the BetterDocs plugin by WPDevTeam (CPE: cpe:2.3:a:wpdevteam:betterdocs_ai_documentation_knowledge_base_mcp_server_docs_wikis_faq_chatbot:*:*:*:*:*:*:*:*). The root cause (CWE-79: Improper Neutralization of Input During Web Page Generation) is a sanitizer bypass via double processing. WordPress's wp_kses_post evaluates entity-encoded attribute values as a single legitimate token and permits them through. Subsequently, Node.php (L22) and the ToC shortcode (ToC.php L75, L147) call html_entity_decode() on the stored content, decoding the attacker's originally-safe encoding into executable JavaScript. A lazy regex then extracts the now-dangerous heading id value before toc.php (L50) echoes it unescaped into the rendered Table of Contents block. This variant of stored XSS - where a sanitizer-safe encoding survives storage but is decoded by downstream plugin processing before output - exploits the semantic gap between what wp_kses_post considers valid and what the plugin's own post-processing pipeline produces.
Know when Wordpress Plugin gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Stored XSS requires victim page visit (UI:R, not UI:N as provided); all other metrics align with contributor-gated network attack with cross-browser scope change.
Primary rating from Vendor (Wordfence).
CVSS VectorVendor: Wordfence
DescriptionCVE.org
The BetterDocs - AI Documentation, Knowledge Base, Docs, Wikis, FAQ with Chatbot plugin for WordPress is vulnerable to Stored Cross-Site Scripting via Heading 'id' Attribute in Post Content in all versions up to, and including, 4.8.1 due to insufficient input sanitization and output escaping. 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. The exploit survives wp_kses_post because entity-encoded quotes in a heading id attribute are treated as a single legitimate attribute value at save time; the dangerous payload only materialises after process_content_for_toc() calls html_entity_decode() on the stored content and the broken id is extracted by a lazy regex before being echoed unescaped into the Table of Contents output.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
More in Wordpress Plugin
View allThe Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
The Hash Form - Drag & Drop Form Builder plugin for WordPress is vulnerable to arbitrary file uploads due to missing fil
Authentication bypass in the LiteSpeed Cache WordPress plugin (versions prior to 6.5.0.1) allows unauthenticated remote
The Simple File List plugin for WordPress through version 4.2.2 contains an unauthenticated remote code execution vulner
The AI Engine WordPress plugin through version 3.1.3 exposes Bearer Token values through the /mcp/v1/ REST API endpoint
The SureTriggers WordPress plugin through version 1.0.82 contains a privilege escalation vulnerability that allows unaut
The Ninja Forms plugin before 2.9.42.1 for WordPress allows remote attackers to conduct PHP object injection attacks via
The Business Directory Plugin - Easy Listing Directories for WordPress plugin for WordPress is vulnerable to time-based
SQL injection in the NotificationX WordPress plugin (versions up to and including 2.8.2) allows unauthenticated remote a
The POST SMTP Mailer - Email log, Delivery Failure Notifications and Best Mail SMTP for WordPress plugin for WordPress i
The MasterStudy LMS WordPress Plugin - for Online Courses and Education plugin for WordPress is vulnerable to union base
The Email Subscribers by Icegram Express plugin for WordPress is vulnerable to SQL Injection via the ‘hash’ parameter in
EUVD-2026-68986
GHSA-xx89-f47v-hmxp
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB