Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-102772 Overview
CVE-2026-102772 is a Stored Cross-Site Scripting (XSS) vulnerability affecting the CMB2 plugin for WordPress in all versions up to and including 2.13.1. The flaw resides in the handling of the textarea_code field type, specifically through parameters such as kl_code and kl_post_code. Insufficient input sanitization and output escaping allow unauthenticated attackers to inject arbitrary JavaScript that executes when users view the affected pages. The front-end save path validates only a CMB2 box nonce, which the plugin emits publicly to any visitor via a GET request. The vulnerability is tracked under [CWE-79] (Improper Neutralization of Input During Web Page Generation).
Critical Impact
Unauthenticated attackers can inject persistent JavaScript on any WordPress site exposing a public CMB2 form that writes a textarea_code field, enabling session theft, defacement, and client-side account takeover.
Affected Products
- CMB2 plugin for WordPress — all versions up to and including 2.13.1
- WordPress sites exposing a public (front-end) CMB2 form containing a textarea_code field
- Deployments that rely on CMB2 nonces as the sole write-path authorization control
Discovery Timeline
- 2026-10-02 - CVE-2026-102772 published to the National Vulnerability Database (NVD)
- 2026-10-03 - Last updated in NVD database
Technical Details for CVE-2026-102772
Vulnerability Analysis
The CMB2 plugin provides a metabox and custom-field framework widely used by WordPress themes and plugins. One of its field types, textarea_code, accepts arbitrary multi-line text intended to represent code snippets. When CMB2 forms are rendered on the front-end, the plugin accepts submissions through an AJAX/POST handler that authorizes the write using only a CMB2 box nonce. Because that nonce is embedded in the public form markup, any unauthenticated visitor can retrieve it with a simple GET request and reuse it to submit values.
The submitted content for a textarea_code field is stored without sufficient sanitization. On render, the stored value is output without adequate escaping, allowing injected <script> content or event-handler attributes to execute in the browser of every subsequent visitor. The vulnerability has scope-changed impact because the injected script executes in the trust context of the WordPress site, including authenticated administrator sessions that later view the affected content.
Root Cause
Two weaknesses combine to produce the issue. First, the sanitization callback for textarea_code fields does not strip or encode HTML-dangerous constructs before persistence. Second, the display callback emits the stored value without appropriate HTML entity encoding. Reviewers can verify both paths in the plugin source: see the CMB2 Sanitize Source Code and the CMB2 Field Display Source Code.
Attack Vector
An attacker loads the public page that renders the vulnerable CMB2 form, extracts the embedded CMB2 nonce, and issues a POST request containing an HTML or JavaScript payload in the textarea_code field parameter (for example, kl_code or kl_post_code). The server stores the payload. The next time a user — including administrators — visits a page that displays this field, the injected script executes in their browser. See the Wordfence Vulnerability Report and the CMB2 Hookup Source Code for the front-end save path.
No verified exploit code is published. The vulnerability mechanism is described above in prose; synthetic payload code is intentionally omitted.
Detection Methods for CVE-2026-102772
Indicators of Compromise
- Unexpected POST requests from unauthenticated clients to WordPress endpoints that process CMB2 form submissions, especially carrying kl_code, kl_post_code, or other textarea_code field identifiers.
- Stored post meta or option values containing <script>, onerror=, onload=, javascript: URIs, or encoded variants in fields managed by CMB2.
- Browser console errors or anomalous outbound requests from administrator sessions after viewing content pages rendered by CMB2.
Detection Strategies
- Audit the WordPress database for stored CMB2 meta values that contain HTML tags or JavaScript event handlers; focus on wp_postmeta and wp_options rows written through CMB2 field keys.
- Deploy a web application firewall (WAF) rule that inspects POST bodies to CMB2 front-end submission routes for script-like payloads in textarea_code parameters.
- Enable WordPress audit logging and correlate anonymous form submissions with subsequent changes to rendered page content.
Monitoring Recommendations
- Monitor web server access logs for anomalous POST volumes against pages hosting public CMB2 forms, particularly from single source IPs.
- Alert on Content Security Policy (CSP) violation reports originating from pages that render CMB2 content.
- Track plugin version inventory across WordPress estates and flag any site still running CMB2 at or below 2.13.1.
How to Mitigate CVE-2026-102772
Immediate Actions Required
- Update the CMB2 plugin to the version containing the fix referenced in the CMB2 Changeset Overview.
- Enumerate all front-end forms using CMB2 and identify any that expose a textarea_code field to unauthenticated users; disable those forms until patched.
- Review stored content for injected script and purge malicious values from wp_postmeta and related tables.
- Rotate administrator credentials and invalidate active sessions if evidence of exploitation is found.
Patch Information
The fix is tracked in the CMB2 plugin repository under changeset 3720258. Review the CMB2 Changeset Overview for the authoritative diff. Site owners should upgrade through the WordPress plugin updater or by replacing the plugin directory with the patched release. Verify the installed version in wp-admin > Plugins after upgrade.
Workarounds
- Remove or restrict public-facing CMB2 forms that write textarea_code fields until the plugin is updated.
- Add a WAF rule or mu-plugin filter that strips HTML and JavaScript from inbound textarea_code submissions before CMB2 processes them.
- Enforce a strict Content Security Policy that disallows inline script execution to reduce impact if injection occurs.
- Require authentication on any page that currently hosts a public CMB2 form, so the nonce is not reachable to anonymous visitors.
# Example WP-CLI commands to verify plugin version and search for suspicious stored content
wp plugin get cmb2 --field=version
wp db query "SELECT meta_id, post_id, meta_key FROM wp_postmeta WHERE meta_value LIKE '%<script%' OR meta_value LIKE '%onerror=%';"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

