CVE-2026-75980: BetterDocs <= 4.8.1 - Authenticated (Contributor+) Stored Cross-Site Scripting via Heading 'id' Attribute in Post Content
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 wpksespost 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 processcontentfortoc() calls htmlentitydecode() on the stored content and the broken id is extracted by a lazy regex before being echoed unescaped into the Table of Contents output.
Affected Software
Event History
Frequently Asked Questions
What level of access does an attacker need?
An attacker must be authenticated with Contributor-level access or higher. No user interaction is required from the attacker after they submit the malicious content.
Who is exposed to the injected script?
The script executes in the browser of any user who accesses a page containing the malicious heading. Installations running BetterDocs versions through 4.8.1 should treat contributor-capable accounts as a relevant attack path.
What content path triggers the issue?
The malicious payload is placed in a heading id attribute in post content. It becomes active when BetterDocs processes that content for its Table of Contents, decodes the stored entities, and outputs the extracted id without escaping.