-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
force host on password reset notification
- Loading branch information
1 parent
0f3003d
commit cef1055
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cef1055
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@taylorotwell
-I pointed A.com's password reset form to B.com's endpoint using B.com's _token.
-B.com received the request and sent an email, but the email still pointed to B.com (5.4.21, before the above change)
Is there another way they are spoofing this?
cef1055
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AdamEsterle in your example you're still hitting B.com's endpoint with B.com's domain. The exploit is in hitting B.com's IP with something other than B.com.
Laravel (prior to this patch) will happily use any hostname and if the web server is not configured to check the host and simply accepts all incoming requests then it's possible to trick the application into sending a spoofed reset link.
From what I gather the exploit is unlikely to be viable on domain-based multi-tenant applications because they inspect and validate domains by design. Ironically this fix breaks the password reset functionality on such applications.
cef1055
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nCrazed I know this bug for a lot of time didnt consider it exploit on the laravel side more bad server configuration...
this change can actually break a lot of laravel code out there as I don't know how many devs are actually changed the config('app.url') as to my knowledge until this point it only used for some artisan command which not everyone used
cef1055
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And even worse, in Laravel 5.1 it said this command was only used for Artisan commands;
cef1055
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbashy not just 5.1, it's the same in the master.
cef1055
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nCrazed Yeah, sorry, I just meant it first appeared in 5.1 (as far as I know) and people now think of it as Artisan based only.
cef1055
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nCrazed Yup, I’m having this problem right now 😩
Just been trawling the Laravel source code for a “nice” place to override the URL used in password reset emails, which has led me here. I have a multi-tenant CMS, but reset URLs are being generated with the application’s domain and not the domain of the site it was created.