Skip to content
Noroxi
Research10 min read

Loginizer Brute-Force Lockout Bypass via Spoofed Client IP

Loginizer keys its brute-force lockout on a spoofable client-IP header, so an unauthenticated attacker can bypass the limit. A defensive analysis of CWE-348.

Noroxi TeamPenetration testing and security consulting

Abstract. Loginizer is a widely deployed WordPress plugin whose job is to throttle and lock out login brute-force attempts. Its lockout counter is keyed on the client IP, and this analysis looks at how that IP is determined. Point the plugin at an HTTP header for the client IP — the normal choice for any site behind a reverse proxy or CDN — and it trusts the raw header value with no trusted-proxy validation. An unauthenticated attacker who controls that header controls the lockout key, which neutralises the plugin's core protection. We cover the vulnerability class, its root cause and a corrective fix so developers and site owners can recognise, prevent and detect it. Under coordinated disclosure, the full operational proof-of-concept stays out of this article until a fix ships.

Keywords: Loginizer, WordPress security, brute-force protection bypass, X-Forwarded-For, IP spoofing, trusted proxy, CWE-348, authentication-security.

1. Introduction

Loginizer is a security plugin with more than 1,000,000 active installations, and brute-force protection is its headline feature. It counts failed login attempts per client IP and, once a configurable threshold is hit, locks that IP out for a while. People install it so that wp-login.php and XML-RPC stop being an open door for credential guessing.

A per-IP control is only as good as its idea of "the client's IP," and that idea gets slippery on the modern web. Most WordPress sites never talk to the visitor directly; they sit behind Cloudflare, a load balancer or a reverse proxy. In that setup the TCP peer address (REMOTE_ADDR) belongs to the proxy, not the visitor, so plugins add a setting to read the real client IP from a forwarded header such as X-Forwarded-For. The feature is necessary and the trap is old: forwarded headers are written by whoever sits upstream, and on an unauthenticated request that includes the attacker. Keying a security decision on an untrusted source is an easy mistake to make, and it quietly defeats the exact protection it sits inside — which is what makes this bug class worth spelling out.

2. Affected component

PluginLoginizer — slug loginizer
Tested version2.1.1 (current at time of testing)
Active installations1,000,000+
Vulnerability typeBrute-force protection bypass via untrusted client-IP source (also enables targeted lockout DoS)
CWECWE-348 Use of Less Trusted Source (related: CWE-290 Authentication Bypass by Spoofing)
Required privilegeNone — unauthenticated, remote
PreconditionAdmin set Loginizer's "IP Method" to X-Forwarded-For (ip_method=1), Client-IP (2) or a custom header (3) — the standard setting for any site behind a reverse proxy / Cloudflare / load balancer. The default (0 = REMOTE_ADDR) is safe.
CVSS 3.1~5.3 (Medium) AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
StatusFresh, confirmed in code and reproduced end-to-end in an isolated localhost lab. Unpatched at time of writing.

3. Technical analysis

The lockout counter, along with whitelist and blacklist matching, is keyed on whatever the plugin's internal helper lz_getip() returns. Pick a header-based IP Method and that helper reads the client-supplied header straight through. For X-Forwarded-For it takes the leftmost entry, with no trusted-proxy validation:

php
// common.php  (lz_getip) — root cause: the header value is attacker-controlledif (isset($_SERVER["HTTP_X_FORWARDED_FOR"]) && @$loginizer['ip_method'] == 1){    if (strpos($_SERVER["HTTP_X_FORWARDED_FOR"], ',')){        $temp_ip = explode(',', $_SERVER["HTTP_X_FORWARDED_FOR"]);        $ip = trim($temp_ip[0]);               // leftmost = attacker-controlled    } else {        $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];    }}if (isset($_SERVER["HTTP_CLIENT_IP"]) && @$loginizer['ip_method'] == 2){ $ip = $_SERVER["HTTP_CLIENT_IP"]; }if (@$loginizer['ip_method'] == 3 && isset($_SERVER[@$loginizer['custom_ip_method']])){ $ip = $_SERVER[@$loginizer['custom_ip_method']]; }if (!lz_valid_ip($ip)){ return ''; }           // only syntactic validation (blocks SQLi, not spoofing)return $ip;

Here is the problem. X-Forwarded-For is a chain that each hop appends to, so the leftmost value is the one nearest the original client — which, on a direct request to the proxy, is simply whatever the client typed. It carries no authentication and no binding to the TCP connection. Reading it verbatim means the plugin takes the client's self-declared identity and uses it as a security key. The lz_valid_ip() check confirms the string is a syntactically valid IP address, which does usefully shut down a header-based SQL-injection vector, but a syntactically valid IP is precisely what a spoofing attacker hands over. At no point does this code confirm that REMOTE_ADDR is a known, trusted proxy before honouring the header.

The returned $ip becomes $loginizer['current_ip'], and that value is what keys the failed-login counter and the whitelist/blacklist comparison.

4. How the flaw is reached (conceptual)

The sink fires on every unauthenticated login request. Loginizer hooks WordPress's authenticate filter, which runs for both wp-login.php and XML-RPC, and before any credential check it resolves "the current IP" through lz_getip() to look up and bump the failed-attempt counter.

In the vulnerable configuration that IP comes from a request header the client fully controls, so the attacker decides which lockout bucket each guess lands in. One root cause produces three distinct abuses:

  • Lockout bypass. A bucket only locks once it crosses the retry threshold. Attribute each guess to a different bucket and no bucket ever reaches the threshold, so the lockout never fires. The plugin's whole premise — a finite number of guesses per client — collapses, and credential guessing against the login endpoints becomes unlimited.
  • Targeted lockout denial-of-service. Run the same trick in reverse: attribute a burst of failed logins to a victim's IP, trip the lockout against a bucket that belongs to a legitimate user, and lock that user out. That is a framing and denial-of-service primitive.
  • Protection skip via whitelist. When an administrator has whitelisted an IP, an attacker who learns or guesses it can present that address in the header, be treated as whitelisted, and skip protection altogether.

All three come from the same defect, trusting an untrusted source, and none of them needs authentication. We leave out the literal request sequence, header values and reproduction commands on purpose; the mechanism above is enough to understand the risk and defend against it.

5. Impact assessment

In practice this is an unauthenticated bypass of the plugin's primary feature — login brute-force throttling — on any site that reads the client IP from a header. That is not an exotic setup. It is the correct, expected configuration for essentially every site behind Cloudflare or a reverse proxy, which covers a very large share of real deployments. On those sites the protection users assume they have is effectively gone against an attacker who rotates the header. The same defect also hands out a targeted lockout DoS that can lock chosen legitimate IPs.

The honest severity is Medium, as the CVSS vector AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L (~5.3) reflects. The attack is network-based, low-complexity and unauthenticated (AV:N/AC:L/PR:N/UI:N). The flaw leaks nothing directly (C:N); the integrity score (I:L) captures the neutralised control and the spoofed state, and the availability score (A:L) captures the targeted lockout. What holds the rating at Medium rather than higher is the dependency on a non-default — though very common — header-based IP-method setting. One caveat: defeating the throttle meaningfully raises the odds of a successful credential-stuffing or password-guessing outcome, even though that downstream compromise is scored on its own.

6. Remediation

For the maintainer — resolve the client IP against trusted proxies instead of trusting the raw header. With a header-based IP Method configured, the real client IP has to be derived from the list of trusted upstream proxies, not read straight from the leftmost X-Forwarded-For entry. The corrective principle:

php
// Resolve the real client IP using a configured trusted-proxy list.// Walk X-Forwarded-For from the RIGHT (closest hop) and return the first// address that is NOT one of our trusted proxies. Fall back to REMOTE_ADDR.function lz_client_ip(array $trusted_proxies) {    $remote = $_SERVER['REMOTE_ADDR'] ?? '';    // Only honour a forwarded header if the direct peer is a trusted proxy.    if (!in_array($remote, $trusted_proxies, true)) {        return $remote;    }    $xff = $_SERVER['HTTP_X_FORWARDED_FOR'] ?? '';    $chain = array_map('trim', explode(',', $xff));    for ($i = count($chain) - 1; $i >= 0; $i--) {        $candidate = $chain[$i];        if (!lz_valid_ip($candidate)) { continue; }        if (!in_array($candidate, $trusted_proxies, true)) {            return $candidate;   // right-most non-proxy = real client        }    }    return $remote;}

The forwarded header is now honoured only when REMOTE_ADDR is itself a known proxy, and the address taken is the right-most entry that is not a trusted proxy, which is the part of the chain an attacker cannot forge past. A security decision should never rest on the left-most attacker-controlled value.

For site owners, until a fix ships:

  • If your site is not behind a proxy or CDN, check that Loginizer's IP Method is still at the default (REMOTE_ADDR); that configuration is not affected.
  • If your site is behind Cloudflare or a reverse proxy, treat the per-IP lockout as currently bypassable and stop relying on it as your only brute-force control. Enforce the protection at the trusted edge, where the real client IP is known — a rate limit or WAF rule at Cloudflare or your load balancer, keyed on the connection rather than on a forwarded header the origin re-reads.
  • Shrink the exposed surface: disable XML-RPC if you do not use it, and require strong, unique credentials plus multi-factor authentication so that beating the throttle does not turn into account compromise.

7. Detection and hardening for site owners

Practical indicators and hardening, drawn only from the mechanics above:

  • Watch for high XFF cardinality against the login endpoints. A legitimate client behind a proxy shows a stable real IP. A flood of distinct leftmost X-Forwarded-For values hitting wp-login.php or xmlrpc.php in a short window, especially from private or reserved ranges, is the signature of header rotation. Your edge or proxy access logs are the place to catch it, not just the plugin's own log.
  • Trust the IP only where it is trustworthy. Make the client-IP decision at the trusted proxy. Configure your origin or WAF to accept a forwarded client IP only from your known proxy addresses (Cloudflare publishes its ranges; load balancers can be pinned by source) and to discard the header otherwise.
  • Rate-limit at the edge. Put a login rate limit or a managed brute-force rule on Cloudflare or the reverse proxy, which sees the genuine connection, rather than leaning on an origin plugin that re-reads a header.
  • Least privilege and defence in depth. Keep admin accounts to a minimum, enforce MFA, use unique strong passwords, and alert on lockout events that target legitimate internal IPs — a sign of the framing/DoS variant.
  • Keep the plugin updated. Apply the vendor fix as soon as it lands; this write-up will be updated when a fixed version is available.

These are general hardening measures, and we describe no plugin feature that does not exist.

8. The broader lesson

The principle is old and simple: never make a security decision from data the subject of that decision controls. An X-Forwarded-For header, a Client-IP header, a Referer, a cookie flag the client can flip — every one of them is a claim, not a fact, until something trustworthy binds it to reality. For client IP the only fact a web server holds is the TCP peer address. A forwarded header earns trust only once you can prove the hop that set it is a proxy you control, and only for the part of the chain beyond that proxy.

Validating the shape of input ("is this a syntactically valid IP?") is a different thing from validating its trustworthiness. Loginizer's syntactic check correctly closes an injection vector but does nothing about spoofing, because syntax says nothing about provenance. Any per-identity control — rate limits, lockouts, allow and deny lists, quotas — should derive identity from an authenticated or infrastructure-bound source, and should fail safe when it cannot.

9. Responsible disclosure

This research was carried out under coordinated (responsible) disclosure, and the vulnerability has been reported privately to the plugin's maintainer. Following this publication's policy, the full operational proof-of-concept — the exact request sequence, header values and reproduction commands — stays out of this public article until a fix is available. The write-up exists to help developers and site owners understand, prevent and detect the bug class, not to make it exploitable.

All testing happened exclusively in an authorized, isolated localhost laboratory against a researcher-controlled installation of the GPL-licensed plugin. No third-party or production systems were touched, and the plugin was removed afterwards. Noroxi LLC conducts authorized security research only.

References


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.

Your address is used only for this email and never shared.

Up next

Maintenance Plugin: Unauthenticated Maintenance-Mode Bypass