Host Header Injection Check: Password Reset Poisoning

Checks whether the application builds its URLs, including password reset links, from a forged host name.

application security Easy fix 20 minutes

What This Check Detects

Checks whether the application builds its URLs, including password reset links, from a forged host name.

Full Documentation

What this check looks for

StackShield requests a few of your pages with a made-up host name, once in the X-Forwarded-Host header and once in the Host header itself, and looks for that name in the URLs your application generates. Each request carries a unique query string so no cache in front of your site can store the response, and no form is submitted.

Why it matters

Laravel builds absolute URLs from the host of the current request. If that host can be set by the visitor, so can the links. The classic attack is password reset poisoning: the attacker requests a reset for a victim's address with a forged host, the victim receives a real reset email whose link points at the attacker's server, and clicking it delivers the token. The same behaviour lets an attacker poison a shared cache with links to their own domain.

The usual cause is trusting every proxy (trustProxies(at: '*')) on a server that is also reachable directly, or having no host restriction at all.

What a failed check means

Your application used our made-up host in its own URLs. Enable the TrustHosts middleware with your real host names, set trusted proxies to the addresses of your actual load balancer or CDN, and make sure the web server rejects requests for unknown hosts.

Related Security Checks

Free security check

Is your Laravel app exposed right now?

34% of Laravel apps we scan have at least one critical issue, and most teams do not find out until something breaks. The free scan checks your live app in 60 seconds. Then StackShield re-runs every check after each deploy, so a fix you ship today does not quietly regress next week.

18% have debug mode on
72% missing security headers
12% have exposed .env
Scan My App Free No signup for the scan. Continuous monitoring on a 14-day trial, no card.