Summary
Wekan's header-based login feature can be bypassed when client-supplied X-Forwarded-For values are trusted over the actual socket IP.
An unauthenticated attacker can spoof a trusted IP, submit a chosen HEADER_LOGIN_ID, and obtain a valid meteor_login_token session, including administrative accounts, whenever header login is enabled and misconfigured.
Affected context
This vulnerability appears in Wekan deployments that use the header-login feature together with HEADER_LOGIN_TRUSTED_IPS for upstream authentication.
It becomes relevant when:
- Requests pass through proxies or load balancers that set
X-Forwarded-For - The application trusts
X-Forwarded-Foras the primary IP source instead of the real socket address - Header-based identity (
HEADER_LOGIN_ID) is accepted without an independent authentication check
Under these conditions, a malicious client can influence the trusted IP decision path.
Exploit preconditions
- Attack surface: Public or internal Wekan HTTP endpoint where
header-loginis enabled - Required access: Network access to the Wekan server; no prior authentication needed
- Trigger point: Submission of crafted HTTP requests that manipulate
X-Forwarded-Fortogether withHEADER_LOGIN_ID - Why exploitation is possible: The authentication logic relies on client-controlled headers to determine whether the request originates from a trusted IP, allowing identity to be asserted via headers without verifying the actual connection source.
Why this happens
The root cause is a flawed authentication design that conflates network locality checks with identity assurance while trusting unvalidated client headers.
Specifically, the logic in getRequestIp() prefers the X-Forwarded-For header over the true socket address when evaluating HEADER_LOGIN_TRUSTED_IPS.
This maps to CWE-287: Improper Authentication because authentication success depends on manipulable headers instead of reliable credentials or transport attributes, and to CWE-290: Authentication Bypass by Spoofing due to IP address spoofing via request metadata.
In abstract terms, any scheme that treats client-controlled headers as authoritative proof of origin or identity creates a bypassable trust boundary.
Potential impact
- An attacker can log in as arbitrary Wekan users by setting
HEADER_LOGIN_IDto chosen usernames. - Administrative accounts can be hijacked, enabling full board, user, and configuration control.
- Data within boards, cards, and attachments may be viewed, altered, or deleted.
- Audit trails and activity histories can be manipulated, obscuring malicious changes.
- The compromised Wekan instance can be used as a pivot point to attack integrated or downstream systems.
General mitigation guidance
Effective mitigation focuses on removing trust in client-supplied headers as an authentication factor and re-establishing clear trust boundaries.
Recommended design patterns include:
- Deriving client IP and origin from the actual socket connection or a tightly controlled reverse proxy, not from arbitrary request headers.
- Treating
X-Forwarded-Forand similar headers as untrusted unless explicitly injected by a hardened, known proxy and stripped from user input. - Ensuring header-based login flows are gated by strong upstream authentication (e.g., SSO, reverse proxy auth) and validating that only the proxy can provide identity headers.
- Implementing least privilege by separating administrative access from header-based convenience login and requiring stronger factors for privileged roles.
- Providing secure-by-default configurations where header login is disabled or restricted, requiring explicit operator opt-in and documentation of safe deployment topologies.
How teams detect issues like this
Detection efforts can focus on both code-level and runtime indicators:
- Static analysis rules that flag authentication decisions based on client-controlled headers such as
X-Forwarded-For,X-Real-IP, or custom identity headers. - Code review checklists that call out any logic in authentication or authorization flows that trusts request metadata without proxy enforcement guarantees.
- Configuration reviews that verify header-based login features are either disabled or only enabled behind a well-defined, authenticated reverse proxy.
- Logging and monitoring patterns that surface unusual use of header login, such as many distinct usernames being accessed from the same apparent IP or anomalous admin login activity.
- Automated security scanning tools configured to test header manipulation in authentication endpoints can help identify similar weaknesses in other services.

