Abstract. A CAPTCHA plugin has one job on every request: decide whether a human challenge is needed here. Google Captcha / reCAPTCHA by BestWebSoft (100,000+ installs) makes that call with a raw
strstr()test against the full request URI. The match is unanchored, so any anonymous visitor can drop a harmless-looking string into the query and turn the challenge off on every protected form. This is a security-feature bypass (CWE-287) with no authentication and no user interaction. We cover the root-cause pattern, why it fails, how the flaw is reached at a conceptual level, and how site owners can detect and contain it. Reported to the vendor under coordinated disclosure; the full working proof-of-concept stays private until a fix ships.
Keywords: WordPress security, CAPTCHA bypass, improper authentication, CWE-287, security-feature bypass, secure coding.
1. Introduction
Google Captcha / reCAPTCHA by BestWebSoft (slug google-captcha) protects 100,000+ WordPress sites. It bolts a reCAPTCHA challenge onto wp-login.php, the registration and lost-password forms, comments and other entry points, so logins can't be brute-forced, registrations can't be scripted, and comment spam gets stopped at the door.
When a plugin's entire reason to exist is a security control, the interesting question isn't whether the challenge renders — it's whether an attacker can influence the decision to show it in the first place. That's the flaw here, an unauthenticated security-feature bypass (CWE-287), and its failure mode is quiet. Nothing breaks on screen. The plugin still reports as active, the admin still sees the reCAPTCHA on their own visits, and the protection is simply gone for any request that asks for it to be gone. A bypass like this doesn't remove the control; it neutralises it, which is exactly why it is easy to miss.
2. Affected component
| Plugin | Google Captcha / reCAPTCHA by BestWebSoft — slug google-captcha |
| Tested version | 1.87 (current/latest at time of testing) |
| Active installations | 100,000+ |
| Vulnerability type | Security-feature bypass / improper authentication protection bypass |
| CWE | CWE-287 Improper Authentication (CWE-290 Authentication Bypass by Spoofing) |
| Required privilege | None — unauthenticated, remote |
| User interaction | None |
| CVSS 3.1 | ~5.3 (Medium) AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| Status | Fresh, confirmed in code and reproduced on a localhost lab; unpatched at time of writing |
3. Technical analysis
A single function, gglcptch_is_recaptcha_required(), decides centrally whether the challenge applies to a request. It opens with an early exit:
// google-captcha.php (gglcptch_is_recaptcha_required)
function gglcptch_is_recaptcha_required( $form_slug = '', $is_user_logged_in = null ) {
global $gglcptch_options;
if ( strstr( $_SERVER['REQUEST_URI'], '/jwt-auth' ) ) { // DEFECT: raw REQUEST_URI incl. query string; no anchoring, no decode, no route check
return false; // -> captcha not required
}
...
}The idea behind that exit is reasonable. The JWT Authentication for WP REST API plugin serves /wp-json/jwt-auth/* routes that can't draw a visual captcha, so they need to be exempt. The problem is how the exemption gets detected. It runs strstr() across the entire REQUEST_URI — path and query string together, all of it attacker-controlled — and it does so with three gaps:
- the value is never URL-decoded;
- the match is unanchored, so
/jwt-authcan sit anywhere in the string, not just at the start of a route; - nothing confirms the request is actually a JWT-Auth REST call — no
REST_REQUESTcheck, no exactrest_routeor path match.
So a trust decision comes straight out of a free-text search over input the client owns end to end. The query string is the attacker's to write. Drop the literal /jwt-auth into it and the test passes, while the request underneath is still an ordinary login, registration or comment post.
One decision, and the rest follows. gglcptch_is_recaptcha_required() also governs whether the enforcement hooks get registered at all, over in includes/forms.php (gglcptch_add_actions, hooked on init):
if ( gglcptch_is_recaptcha_required( 'login_form', $is_user_logged_in ) ) {
add_action( 'login_form', 'gglcptch_login_display' );
add_action( 'authenticate', 'gglcptch_login_check', 21, 1 ); // enforcement hook — never added when the early-exit fires
}
if ( gglcptch_is_recaptcha_required( 'registration_form', $is_user_logged_in ) ) { ... }
if ( gglcptch_is_recaptcha_required( 'reset_pwd_form', $is_user_logged_in ) ) { ... }If the early exit returned false, none of those hooks attach for the request, and gglcptch_login_check(), gglcptch_register_check() and the comment checks never fire. The challenge isn't just hidden from view — the server-side verification was never wired up.
4. How the flaw is reached (conceptual)
No special vantage point, no credentials. On every request the plugin recomputes the enforce-or-skip decision from a string the caller hands it, and because that string is matched as an unanchored substring over the whole URI (query included), the caller can satisfy the "this is a JWT-Auth route, skip the captcha" branch while submitting a perfectly normal protected form.
The reason an anonymous actor can walk into the unprotected path is structural rather than incidental. The exemption trusts a property of the URL that it never actually validates; nothing ties it back to a real REST route, so it can be satisfied by a request that was never a REST request at all. Once it fires, enforcement for login, registration, lost-password and comments is skipped for that request, and the form goes through with the plugin's protection absent.
The exact request shape, the payload values and the step-by-step reproduction are left out on purpose. For a defender the mechanism is the whole lesson: a control that decides its own fate from unvalidated, attacker-shaped input can be switched off at will. The operational recipe stays with the vendor until a fix ships.
5. Impact assessment
With no authentication and no interaction, the reCAPTCHA can be dropped from the login, registration, lost-password and comment forms — the plugin's entire remit. That hands back exactly what the site deployed it to prevent: credential-stuffing and brute-force against wp-login.php, scripted spam registrations, and comment spam.
The bug yields no code execution and leaks no data on its own, so the damage lands on the integrity of the control rather than on the site's confidentiality or availability. That supports an honest base score of Medium — AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N, about 5.3. A triager could fairly argue for more, since the flaw disarms a security product across the whole site, on demand, for anyone who asks. How far the real-world risk runs — account takeover through unthrottled brute-force — comes down to password strength and whatever rate-limiting sits elsewhere in the stack.
6. Remediation
Stop deriving trust from an unanchored substring of attacker input, and check the thing you actually mean: that the request really is the JWT-Auth REST route.
// Only exempt genuine JWT-Auth REST requests.
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
$path = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ); // decoded path only, no query string
if ( preg_match( '#/wp-json/jwt-auth/#', (string) $path ) ) {
return false;
}
}Three properties make the corrected check sound: it gates on REST_REQUEST, it matches the path only and never the query string, and it anchors to the real route prefix instead of a floating substring. The secondary IP-allowlist weakness wants the same discipline — resolve the client address from REMOTE_ADDR (or a configured, trusted-proxy resolution), never from client-supplied X-Forwarded-For, X-Real-IP or Client-IP headers.
In operational terms, update to a fixed release the moment the vendor publishes one. Until then, the hardening below buys time.
7. Detection and hardening for site owners
Everything here follows from the mechanics above — no invented product features:
- Look for the tell in your request logs. A successful post to
wp-login.php, the registration endpoint orwp-comments-post.phpwhose URL carries an out-of-place/jwt-auth— especially in the query string — is a strong sign that someone is tripping the exemption. Real JWT-Auth traffic lives at/wp-json/jwt-auth/…as an actual REST route, not as a query parameter hung off a login page. - Rate-limit where the plugin can't be bypassed. Since the flaw removes the plugin's control, put brute-force protection somewhere that doesn't depend on it: server- or WAF-level rate limiting on
wp-login.php, lockouts after repeated failures, and alerting on credential-stuffing patterns. - Lean on strong authentication. Strong, unique passwords and multi-factor authentication everywhere make an unthrottled login endpoint far less rewarding to attack.
- Trim the attack surface. Turn off registration and comment forms you don't use. If JWT-Auth has no role on your site, that's one less moving part to reason about.
- Virtual patching. A WAF rule that strips or rejects a
/jwt-authsubstring on non-REST endpoints —wp-login.phpand comment posts — is a fair stopgap, as long as it's scoped tightly enough to leave genuine/wp-json/jwt-auth/REST traffic alone. - Track the changelog. Keep everything current and watch the vendor's release notes so the fix goes on the day it lands.
8. Broader lesson
The principle predates WordPress by decades: never make a security decision from unvalidated, attacker-controlled input, and never stand in for a precise condition with a loose string match. An exemption is a security decision. If it means "this is the JWT-Auth REST route," the code has to verify that exact thing — the request context (REST_REQUEST) and the canonical, decoded route path — not a substring that merely tends to show up when the real condition is true.
Three anti-patterns meet in this one line, and each is worth keeping in muscle memory:
- A substring standing in for a boundary.
strstr()andstrpos()answer "does this text appear somewhere?" — almost never the question a router or an authorizer is really asking. Anchor and parse instead. - Trusting the whole input when only part of it matters. The query string is not the route. Decode and isolate the component you mean — the path — before you match on it.
- Exemptions that allow by default. An exemption that switches a control off is far more dangerous than one that switches a feature on. It should be the narrowest, most precisely checked branch in the function, and it should fail closed.
The same logic finishes off the secondary variant: an IP allowlist has to be matched against an address the server can trust — REMOTE_ADDR — not a header the client gets to set.
9. Responsible disclosure
This work was carried out and published under coordinated disclosure. The vendor has the full technical detail and a working proof-of-concept in private, enough to reproduce and fix the issue. The operational exploit detail is deliberately held back from this public write-up until a fixed release is out (or the agreed disclosure window closes), so no one walks away with a ready-to-run weapon against an unpatched control.
Testing ran entirely on an isolated, localhost-bound lab instance of the public GPL plugin, against a test user created for the job. No third-party systems were touched, and the lab and its test account were torn down afterwards. Noroxi LLC performs authorized security research only and does not test systems it has no permission to test.
References
- CWE-287: Improper Authentication — https://cwe.mitre.org/data/definitions/287.html
- CWE-290: Authentication Bypass by Spoofing — https://cwe.mitre.org/data/definitions/290.html
- FIRST CVSS v3.1 calculator — https://www.first.org/cvss/calculator/3.1
- OWASP Authentication Cheat Sheet — https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html
- WordPress REST API handbook — https://developer.wordpress.org/rest-api/
- WordPress plugin security handbook — https://developer.wordpress.org/apis/security/
Published for defensive and educational purposes. Noroxi LLC conducts authorized security research only; operational exploit detail is withheld until a fix is available.
Exploited this week · every Monday
New KEV entries, fresh PoCs, WordPress triage and what to do this week. No account needed.