CVE-2026-3875 Overview
The BetterDocs plugin for WordPress contains a Stored Cross-Site Scripting (XSS) vulnerability in the betterdocs_feedback_form shortcode affecting all versions up to and including 4.3.8. This vulnerability stems from insufficient input sanitization and output escaping on user-supplied shortcode attributes, allowing authenticated attackers with contributor-level access or higher to inject arbitrary web scripts into pages. These malicious scripts execute whenever a user accesses an injected page, potentially leading to session hijacking, credential theft, or further compromise of the WordPress site.
Critical Impact
Authenticated attackers with contributor-level access can inject persistent malicious scripts that execute in the browsers of all users visiting affected pages, enabling session hijacking and potential site takeover.
Affected Products
- BetterDocs WordPress Plugin versions up to and including 4.3.8
- WordPress sites using vulnerable BetterDocs plugin versions
- Any WordPress installation with contributor-level user access enabled
Discovery Timeline
- April 16, 2026 - CVE-2026-3875 published to NVD
- April 16, 2026 - Last updated in NVD database
Technical Details for CVE-2026-3875
Vulnerability Analysis
This Stored Cross-Site Scripting vulnerability exists within the BetterDocs feedback form shortcode implementation. The core issue lies in the plugin's failure to properly sanitize and escape user-controlled shortcode attributes before rendering them in the HTML output. When a contributor or higher-privileged user creates or edits a post containing the betterdocs_feedback_form shortcode with malicious attribute values, these values are stored in the database and rendered without proper encoding whenever the page is accessed.
The vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation), which represents one of the most common web application security flaws. In this case, the attack persists across page loads because the malicious payload is stored server-side rather than requiring a specially crafted URL.
Root Cause
The root cause of this vulnerability is insufficient input validation and output escaping in the feedback-form.php shortcode view file. WordPress shortcodes accept user-defined attributes that should be treated as untrusted input. The vulnerable code path fails to apply proper sanitization functions such as esc_attr(), esc_html(), or wp_kses() before outputting attribute values in the rendered HTML. This allows attackers to break out of attribute contexts and inject arbitrary JavaScript code.
Attack Vector
The attack exploits the network-accessible nature of WordPress sites combined with the shortcode attribute parsing mechanism. An attacker requires contributor-level access or above to create or edit posts containing shortcodes. The attack flow involves:
- An authenticated user with contributor privileges creates a new post or edits an existing one
- The attacker inserts the betterdocs_feedback_form shortcode with crafted malicious attribute values containing JavaScript payloads
- The post is saved, storing the malicious payload in the WordPress database
- When any user (including administrators) views the published page, the malicious script executes in their browser context
- The injected script can steal session cookies, perform actions on behalf of the victim, or redirect users to malicious sites
The vulnerability does not require user interaction beyond normal page viewing, and the scope is changed as the malicious scripts execute in the context of the victim's session rather than the attacker's session.
Detection Methods for CVE-2026-3875
Indicators of Compromise
- Unusual JavaScript code within post content containing betterdocs_feedback_form shortcode
- Unexpected shortcode attributes with encoded characters, script tags, or event handlers
- Browser console errors or unexpected script execution on pages with BetterDocs feedback forms
- User reports of suspicious redirects or behavior when viewing documentation pages
Detection Strategies
- Audit all posts and pages containing the betterdocs_feedback_form shortcode for malicious attribute values
- Implement Content Security Policy (CSP) headers to detect and block inline script execution
- Review WordPress database for suspicious content in wp_posts table, particularly in post_content fields containing BetterDocs shortcodes
- Enable WordPress debug logging to capture any unusual script errors or warnings
Monitoring Recommendations
- Deploy web application firewall (WAF) rules to detect XSS payloads in POST requests to WordPress admin endpoints
- Monitor contributor and author user activities for suspicious post editing patterns
- Implement real-time alerting for new posts or edits containing potentially malicious JavaScript patterns
- Use endpoint detection to identify browser-based attacks originating from compromised WordPress pages
How to Mitigate CVE-2026-3875
Immediate Actions Required
- Update BetterDocs plugin to version 4.3.9 or later immediately
- Audit existing posts and pages for any injected malicious content in shortcode attributes
- Review user accounts with contributor-level access or higher for unauthorized activity
- Consider temporarily disabling the BetterDocs feedback form feature until the update is applied
Patch Information
The BetterDocs development team has addressed this vulnerability in version 4.3.9. The fix implements proper input sanitization and output escaping for shortcode attributes in the feedback-form.php view file. Administrators should update via the WordPress plugin update mechanism or download the patched version directly from the WordPress plugin repository. The specific changes can be reviewed in the WordPress Plugin Change Log. Additional vulnerability details are available in the Wordfence Vulnerability Report.
Workarounds
- Restrict contributor and author role capabilities using a role management plugin until patching is complete
- Implement a Web Application Firewall (WAF) with XSS detection rules to filter malicious payloads
- Temporarily remove or disable the BetterDocs plugin if immediate patching is not possible
- Add Content Security Policy headers to prevent inline script execution as a defense-in-depth measure
# Example: Add CSP headers in .htaccess as temporary mitigation
# Add to WordPress root .htaccess file
Header set Content-Security-Policy "script-src 'self'; object-src 'none';"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

