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. |
There was a problem hiding this comment.
<?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)