CVE-2026-11371 Overview
CVE-2026-11371 is a stored Cross-Site Scripting (XSS) vulnerability [CWE-79] in the BetterDocs WordPress plugin before version 4.5.5. The plugin fails to sanitize AI-generated documentation summaries before storing and rendering them. The summary-generation feature is exposed to unauthenticated users, allowing attackers to inject malicious payloads through prompt injection. Injected scripts execute in the browser of any visitor who views the affected documentation page, including site administrators.
Critical Impact
Unauthenticated attackers can inject persistent JavaScript that runs in administrator browsers, enabling session theft, privilege escalation, and site takeover.
Affected Products
- BetterDocs WordPress plugin versions prior to 4.5.5
- WordPress sites exposing the plugin's AI documentation summary feature
- Any administrator or visitor session viewing affected documentation pages
Discovery Timeline
- 2026-07-16 - CVE-2026-11371 published to NVD
- 2026-07-16 - Last updated in NVD database
Technical Details for CVE-2026-11371
Vulnerability Analysis
The vulnerability combines two distinct weaknesses in the BetterDocs plugin. First, the AI documentation summary generation endpoint accepts input from unauthenticated users. Second, the plugin stores the AI-generated output and renders it in documentation pages without HTML sanitization or output encoding.
An attacker submits a crafted prompt that manipulates the large language model (LLM) into producing output containing HTML or JavaScript. This technique, known as prompt injection, causes the model to embed attacker-controlled markup within its response. Because the plugin trusts the model output and writes it directly into page content, the injected script becomes persistent and executes for every subsequent visitor.
Execution occurs in the browser of any user who loads the affected documentation page. When an administrator views the page, the payload runs with administrative session privileges, enabling account hijack, plugin installation, or arbitrary content modification.
Root Cause
The root cause is missing output sanitization on AI-generated content combined with an unauthenticated attack surface. The plugin treats LLM output as trusted data rather than untrusted user input. Standard WordPress sanitization functions such as wp_kses_post() or esc_html() are not applied before storage or rendering.
Attack Vector
Exploitation requires network access to the target WordPress site and user interaction from a victim who loads the compromised page. The attacker sends a crafted request to the unauthenticated summary-generation endpoint, embedding prompt-injection instructions that direct the AI to output JavaScript. The generated payload is stored server-side and executes on page view, producing a scope change from attacker context to victim browser context.
No verified public exploit code is available. Refer to the WPScan Vulnerability Report for additional technical detail.
Detection Methods for CVE-2026-11371
Indicators of Compromise
- Unexpected <script>, <img onerror=>, or event-handler attributes stored within BetterDocs documentation post content in the wp_posts table
- Outbound requests from administrator browsers to unknown domains shortly after viewing documentation pages
- Unauthenticated POST requests to BetterDocs AI summary generation endpoints in web server access logs
Detection Strategies
- Audit BetterDocs documentation entries for HTML tags, JavaScript keywords, or encoded payloads such as javascript:, onerror=, or String.fromCharCode
- Review web server logs for unauthenticated requests to plugin AJAX or REST endpoints associated with AI summary generation
- Enable Content Security Policy (CSP) reporting to capture blocked inline script executions on documentation pages
Monitoring Recommendations
- Monitor administrator session activity for unexpected privilege actions following documentation page visits
- Alert on new administrator accounts, plugin installations, or theme edits that correlate with documentation page views
- Track anomalous outbound HTTP requests originating from browser sessions authenticated to WordPress admin
How to Mitigate CVE-2026-11371
Immediate Actions Required
- Update the BetterDocs WordPress plugin to version 4.5.5 or later
- Audit all existing documentation content for injected scripts and remove malicious entries
- Rotate administrator credentials and invalidate active sessions if compromise is suspected
- Review WordPress user accounts for unauthorized additions or role changes
Patch Information
The vendor addressed CVE-2026-11371 in BetterDocs version 4.5.5. The fix applies output sanitization to AI-generated summaries and should restrict the summary-generation feature from unauthenticated access. Consult the WPScan Vulnerability Report for advisory details.
Workarounds
- Deactivate the BetterDocs plugin until the patch can be applied
- Deploy a Web Application Firewall (WAF) rule blocking unauthenticated requests to BetterDocs AI endpoints
- Enforce a strict Content Security Policy that disallows inline scripts on documentation pages
- Restrict access to /wp-admin/admin-ajax.php and REST API endpoints via IP allowlisting where feasible
# Example WAF rule concept (ModSecurity) to block unauthenticated AI summary requests
SecRule REQUEST_URI "@contains betterdocs" \
"id:1026113710,phase:1,deny,status:403,\
chain,msg:'Block unauth BetterDocs AI summary'"
SecRule &REQUEST_COOKIES:wordpress_logged_in "@eq 0"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

