Laravel does not properly constrain the host portion of a password-reset URL
Research is free — Hunters explains how the bug works, the root-cause code pattern, how the fix addresses it, and how to test whether a target is affected, in chat. Investigate & write exploit is a paid run — the engine reads the advisory and fix commits, then builds and validates a working proof-of-concept exploit with reproduction steps.
Affected versions
5.4.0 → fixed in 5.4.225.3.0 and later (no fix listed)
Details
Laravel 5.4.x before 5.4.22 does not properly constrain the host portion of a password-reset URL, which makes it easier for remote attackers to conduct phishing attacks by specifying an attacker-controlled host.
The fix
force host on password reset notification
src/Illuminate/Auth/Notifications/ResetPassword.php+1 −1
@@ -46,7 +46,7 @@ public function toMail($notifiable){return (new MailMessage)->line('You are receiving this email because we received a password reset request for your account.')-->action('Reset Password', route('password.reset', $this->token))+->action('Reset Password', url(config('app.url').route('password.reset', $this->token, false)))->line('If you did not request a password reset, no further action is required.');}}
References
- ADVISORYhttps://nvd.nist.gov/vuln/detail/CVE-2017-9303
- WEBhttps://github.com/laravel/framework/commit/cef10551820530632a86fa6f1306fee95c5cac43
- WEBhttps://github.com/FriendsOfPHP/security-advisories/blob/master/illuminate/auth/CVE-2017-9303.yaml
- WEBhttps://github.com/FriendsOfPHP/security-advisories/blob/master/laravel/framework/CVE-2017-9303.yaml
- WEBhttps://laravel-news.com/laravel-5-4-22-is-now-released-and-includes-a-security-fix
- WEBhttps://laravel.com/docs/5.4/releases#laravel-5.4.22
- WEBhttps://web.archive.org/web/20171021180417/http://www.securityfocus.com/bid/98776
- WEBhttp://www.securityfocus.com/bid/98776