- Product
- reCaptcha by WebDesignBy (WordPress plugin)
- Versions
- Before 2.0 · fixed in 2.0
- Severity
- LowCVSS score 3.5 · WPScan
- CVE
- CVE-2026-4512, assigned by WPScan
- Found by
- Mustafa Ahmed, Fortress MSSP
- Published
- November 11, 2026CVE published by WPScan on April 23, 2026
Description
The reCaptcha by WebDesignBy WordPress plugin before 2.0 does not sanitize or escape the Site Key setting before outputting it in a JavaScript string context via the grecaptcha_js() function. This allows administrators on multisite installations (who do not have the unfiltered_html capability) to inject arbitrary JavaScript that executes for all visitors to the WordPress login page.
From the CVE record · CWE-79 Cross-Site Scripting (XSS)
Technical analysis
grecaptcha_js() prints the saved Site Key ($this->_site_key) into an inline <script> block with a plain echo, placing it inside a single quoted JavaScript string literal. Nothing escapes or encodes the value, so a Site Key containing a single quote or a closing </script> tag can terminate the string or the script element, and the rest of the value is then parsed by the browser as script or HTML.
public function grecaptcha_js(){
?>
<script type="text/javascript">
var recaptcha1;
var onloadCallback = function() {
recaptcha1 = grecaptcha.render('g-recaptcha1', {
'sitekey' : '<?php echo $this->_site_key; ?>',
'theme' : 'light'
});
};
</script>
<?php
}
Version 2.0 emits the Site Key with wp_json_encode() instead of echoing it between handwritten quotes, so the value is written out as an encoded JSON string literal rather than as raw text.
public function grecaptcha_js(){
?>
<script type="text/javascript">
var recaptcha1;
var onloadCallback = function() {
recaptcha1 = grecaptcha.render('g-recaptcha1', {
'sitekey' : <?php echo wp_json_encode( $this->_site_key ); ?>,
'theme' : 'light'
});
};
</script>
<?php
}
Fortress’s reading of the public source code at the versions shown.
Proof of concept
As published by WPScan in its advisory on April 2, 2026.
1. Install WP reCaptcha by WebDesignBy v1.7 on a multisite WordPress installation
2. Log in as a site administrator
3. Navigate to Settings > reCaptcha
4. Enter the following payload in the Site Key field: </script><svg/onload=alert(123)//>
5. Save settingsSeverity
WPScan rates it 3.5 (low). CISA’s ADP scores it 3.5 (low) in the CVE record.
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:L/I:L/A:NCISA ADP
Remediation
Update WP reCaptcha by WebDesignBy to 2.0 or later.
Disclosure timeline
- CVE ID reserved by WPScan.
- Fix committed to the plugin repository (r3491730).
- Version 2.0 released.
- WPScan advisory published.
- CVE published by WPScan.
- Published on this site.
Credit
Found and reported by Mustafa Ahmed of Fortress MSSP. The CVE record credits Mustafa Ahmed as finder and WPScan as coordinator.
WPScan's advisory lists Mustafa Ahmed as original researcher and submitter, with fortressmssp.com as the submitter's website.