-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use timing safe string comparison in CSRF filter #3126
Conversation
I somehow would prefer if we convert this to a class. Route::filter('csrf', 'Illuminate\Foundation\Filters\VerifyCsrfToken'); This way if we need to improve the functionality, developer just need to run |
Yes I guess that is why Taylor move it to the core in L5 (see the related PR above), I think it's probably too late to change that in 4.2? |
IMHO it easier to tell developer to replace the closure with above versus you need to add the import, change line x with y, but that just me. |
No I agree, that would be a better option. |
@@ -1,4 +1,5 @@ | |||
<?php | |||
use Symfony\Component\Security\Core\Util\StringUtils; |
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.
<?php
use Symfony\Component\Security\Core\Util\StringUtils;
New line before code please.
@GrahamCampbell before I fix your CS issues, what do you think about moving the filter to the framework as suggested? |
It's already in the framework as of 5.0. I don't see the urgent need to put it in 4.2 as well. |
|
Use a timing safe comparison, as provided by the Symfony Security Component.
See for more information: laravel/laravel#3126
Use a timing safe comparison, as provided by the Symfony Security Component.
As proposed by by @lasselehtinen and @ircmaxell in ba0cf2a
(I'm not a security expert, so they more knowledge about this)