highAgent ThreatPrompt Injection

BetterDocs WordPress Plugin Stored XSS via Unsanitized AI-Generated Content

First seen Jul 16, 2026 · Updated Jul 16, 2026

wordpressstored-xssai-generated-contentunauthenticatedprompt-injectionplugin-vulnerabilityASI02 · Tool MisuseAML.T0051Surface: Human InterfacePropagation: Single Hop

The BetterDocs WordPress plugin before version 4.5.5 lets unauthenticated users trigger an AI documentation-summary feature whose output is stored and rendered without sanitization. An attacker can craft input that causes the AI to emit malicious HTML/JavaScript, which then executes as stored XSS in the browser of anyone viewing the page, including site administrators.

Technical Analysis

The entry point is an unauthenticated-facing AI summarization feature that accepts attacker-influenced input and passes it to an LLM to generate documentation summaries. Because the output is stored server-side and rendered in the WordPress admin/frontend without output encoding or sanitization, an attacker can use prompt injection to manipulate the AI into producing content containing executable script tags or event handlers. This crosses a trust boundary: content nominally generated by a 'trusted' AI process is treated as safe and rendered in privileged contexts (e.g., admin dashboards), enabling classic stored XSS with the added twist that the payload is laundered through an AI generation step rather than being directly attacker-supplied markup. The attacker gains script execution in victim browsers, potentially leading to admin session hijacking, plugin/theme modification, or full site takeover.

Affected Systems

BetterDocs WordPress Plugin

Detection Signatures

  • Unusual <script> or on*= attributes appearing in stored AI-generated documentation summaries
  • Unauthenticated POST/API requests to BetterDocs AI summary generation endpoints
  • Admin-viewed pages triggering unexpected outbound requests or DOM modifications after viewing documentation content
  • WordPress audit logs showing summary content updates without corresponding authenticated user sessions

Remediation Steps

  1. 1

    Update BetterDocs to 4.5.5 or later

    Apply the vendor patch that sanitizes AI-generated summary output before storage and rendering.

  2. 2

    Enforce output encoding on AI-generated content

    Ensure any content produced by AI features is HTML-escaped or passed through a strict allowlist sanitizer (e.g., DOMPurify server-side equivalent) before storage and display.

  3. 3

    Require authentication for AI generation endpoints

    Restrict access to the summary-generation feature to authenticated, authorized users to reduce unauthenticated attack surface.

  4. 4

    Apply Content Security Policy

    Deploy a strict CSP on WordPress admin and public pages to reduce impact of any stored script injection.

  5. 5

    Audit stored AI-generated content

    Scan existing stored documentation summaries for injected script patterns and purge malicious entries.

CVE / Advisory IDs

CVE-2026-11371

Industries Most Exposed

Web hosting/CMS operatorsSaaS/software vendorsany organization running public-facing WordPress sites

Sources

Respond to this threat

Pro subscribers get a full AI-generated incident-response playbook for this threat — detection, containment, eradication, and recovery steps — plus an unlimited AI Threat Advisor for questions about your environment.