Summary
The 9Router dashboard login rate limiter identifies clients using the attacker-controlled X-Forwarded-For header, allowing spoofed IPs to evade lockout rules.
By rotating this header on each request, a remote attacker can bypass the five-attempt threshold and progressive lockout durations, enabling unlimited brute-force password guessing.
Affected context
This vulnerability appears in 9Router deployments that rely on the dashboard's built-in login rate limiter to restrict password-guessing attempts.
It is relevant when the application trusts X-Forwarded-For as the principal identifier for rate limiting, and when attackers can freely set or modify this header at the HTTP boundary.
Environments without strict upstream proxy controls or header sanitization are more likely to expose this issue.
Exploit preconditions
- Attack surface: Public-facing dashboard login endpoint (
/api/auth/login) - Required access: Ability to send HTTP requests to the dashboard and set arbitrary X-Forwarded-For headers
- Trigger point: Each login attempt that invokes
checkLockandrecordFailusing the spoofable client identifier - Why exploitation is possible: The rate limiter keys its buckets on X-Forwarded-For, a client-controlled header, allowing attackers to rotate values to evade per-client thresholds and lockouts
Why this happens
The bug stems from using an untrusted, client-supplied header as the canonical source of client identity for rate limiting.
In loginLimiter.js, the limiter derives the client identifier from X-Forwarded-For and in login/route.js this value is fed into checkLock and recordFail without validation or normalization.
This maps to CWE-307: Improper Restriction of Excessive Authentication Attempts, where mechanisms intended to cap login retries can be bypassed due to flawed assumptions about how clients are identified.
Potential impact
- Attackers may perform unlimited brute-force login attempts against dashboard credentials.
- Attackers could eventually discover weak or reused passwords and gain unauthorized dashboard access.
- Compromised dashboards can lead to manipulation of routing rules, token handling, or connected AI workflows.
- Increased authentication noise may obscure detection of targeted password attacks.
General mitigation guidance
Effective mitigation focuses on using trustworthy identifiers and layered controls for authentication attempt limiting.
Common defensive patterns include:
- Deriving client identity from server-controlled properties (e.g., connection IP from the trusted reverse proxy) rather than raw X-Forwarded-For.
- Normalizing and validating any proxy headers using a known, fixed proxy chain and ignoring untrusted headers at the edge.
- Implementing account-centric rate limits (e.g., per-username or per-account lockouts) in addition to IP-based limits.
- Applying multi-factor authentication for administrative dashboards so that password brute forcing alone cannot yield full access.
- Designing lockout mechanisms and anomaly detection workflows to trigger alerts on unusual login patterns.
How teams detect issues like this
Detection typically involves a mix of runtime monitoring and code-level review:
- Reviewing authentication and rate-limiting code for reliance on client-controlled headers (X-Forwarded-For, X-Real-IP) as primary identifiers.
- Applying static analysis or linting rules that flag untrusted header usage in security-sensitive flows like login and lockout checks.
- Monitoring authentication logs for patterns of many failed attempts with varying X-Forwarded-For values but identical usernames or credentials.
- Enforcing architectural policies that clearly define which components are allowed to set or trust proxy-related headers, backed by configuration checks in CI/CD.

