Build Security Links from Trusted Origins
Applications often need to send absolute links in email: password-reset links, email-verification links, invitation links, and similar security-sensitive URLs. A convenient implementation takes the hostname from the incoming HTTP request and combines it with a generated token. That convenience can cross a trust boundary. Request host information is input, and deployments may also receive forwarded host information from proxies. If an attacker can influence the value used to build a security link, the application can generate a valid secret token but place it inside a URL for the wrong origin. A user who follows that URL may disclose the token to a host the application does not trust.