BetterDocs heading IDs permit Contributor-level stored cross-site scripting
BetterDocs through 4.8.1 permits a Contributor or higher to place entity-encoded quotes in a heading id attribute. The value survives wp_kses_post(), then process_content_for_toc() decodes the stored content, extracts the malformed id, and emits it into the Table of Contents without adequate escaping, causing stored script to execute when a user views the affected page.
- Component
- BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot
- Plugin slug
betterdocs- Affected
- <= 4.8.1
- Safe version
- See mitigation notes
- Published
- Sep 01, 2026
This CVE was published Sep 01, 2026 and is one of 14 known issues for this plugin.
Update, patch or deactivate.
Update to a confirmed release newer than 4.8.1 when available. Until then, restrict untrusted Contributor access or disable the affected Table of Contents output when warranted, remove malicious heading attributes, and invalidate privileged sessions if affected pages were viewed.
No confirmed safe version is listed. Consider a vendor-supported patch or temporarily restricting the affected functionality while you assess the risk.
Deactivate only when warranted by your risk profile, or when advised by your hosting provider in the limited circumstances where the vulnerability cannot otherwise be mitigated. If you’re unsure which action is appropriate, contact Fused or your hosting provider for guidance.
Technical description
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.
CVE / CNA vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Primary and upstream sources
- NVD record for CVE-2026-75980
- WordPress upstream reference plugins.trac.wordpress.org
- WordPress upstream reference plugins.trac.wordpress.org
- WordPress upstream reference plugins.trac.wordpress.org
- WordPress upstream reference plugins.trac.wordpress.org
- WordPress upstream reference plugins.trac.wordpress.org
- Wordfence advisory wordfence.com