Summary
A Host Header Injection flaw in e107's password reset functionality allows attackers to manipulate the HTTP Host header so that generated password reset links point to attacker-controlled domains.
When users receive and follow these crafted links, they can be tricked into disclosing credentials or authorizing actions on a malicious site, increasing the risk of phishing-driven account takeover.
Affected context
This vulnerability occurs in e107 CMS deployments where the application constructs absolute URLs for password reset emails by trusting the incoming HTTP Host header.
It is relevant in environments where:
- The application is accessible over the internet
- Reverse proxies, CDNs, or load balancers pass the Host header through without strict normalization
- The application does not enforce an allowlist of valid canonical domains for link generation
Exploit preconditions
- Attack surface: Public-facing password reset endpoint of the e107 CMS.
- Required access: Ability to send HTTP requests to the site and trigger the "forgot password" workflow (no prior authentication needed).
- Trigger point: The password reset request where the application builds a reset link using the value of the Host header.
- Why exploitation is possible: The application trusts the Host header as a source of authority for its own domain, without validating it against a configured canonical domain or allowlist, aligning with CWE-20 (Improper Input Validation) and CWE-807 (Reliance on Untrusted Inputs in a Security Decision).
Why this happens
The core issue is improper input validation of the HTTP Host header used within a security-sensitive workflow.
Instead of deriving the application's base URL from a trusted configuration, the implementation treats the Host header as authoritative and uses it to construct password reset links.
This trust extends an unvalidated, attacker-controlled header into a security decision: determining where users will be directed to complete password resets.
Conceptually, this reflects:
- CWE-20: Improper Input Validation — failing to sanitize or validate the Host header against expected values.
- CWE-807: Reliance on Untrusted Inputs in a Security Decision — using attacker-controlled host data to build URLs for an authentication-related process.
Potential impact
- Users may receive legitimate-looking password reset emails containing links to attacker-controlled domains.
- Attackers could host phishing pages mimicking the real site to capture credentials or multi-factor authentication codes.
- Account takeover can occur if users enter new passwords or existing credentials on the attacker's site.
- Session tokens or sensitive information may be harvested if the phishing flow mirrors real application behavior.
- Reputation damage for site owners due to successful phishing campaigns leveraging official emails.
General mitigation guidance
Effective mitigation centers on removing trust in client-controlled Host headers for any security-sensitive decision:
- Derive the canonical application URL from server-side configuration or environment variables rather than from request headers.
- Enforce an allowlist of valid hostnames and reject or normalize any request whose Host header is not in that set.
- For password reset and similar flows, construct absolute URLs using a fixed trusted base URL, independent of the inbound request.
- Apply consistent input validation patterns for all request metadata used in authentication, link generation, and redirects.
- Where multiple domains are intentionally supported, map request hosts to a predefined configuration and fail closed for unknown values.
How teams detect issues like this
Organizations can detect and monitor for this class of issue through:
- Code review checks for usages where URLs in password reset, verification, or login-related flows are built from
$_SERVER['HTTP_HOST'], framework request host accessors, or similar header-derived fields. - Static analysis rules that flag security-sensitive features (password reset, email verification, SSO, redirects) when they depend on unvalidated Host or X-Forwarded-Host headers.
- Configuration audits to ensure the application uses canonical domain settings and that reverse proxies normalize or override Host headers.
- Runtime monitoring of logs for anomalous or unexpected Host values, especially those pointing to external domains, which can indicate attempted exploitation.

