You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was merged into the master branch. Commits ------- c543116 Improve timing safe comparison function Discussion ---------- Improve timing safe comparison function in Security bundle to not leak length information. Improve the timing safe comparison function to better handle cases where input is of different length. Note that it is now important to always pass any string that the user can directly control to the second parameter of the function. Otherwise, length information may be leaked. --------------------------------------------------------------------------- by ircmaxell at 2012-12-29T13:36:32Z @apfelbox: No, for two reasons. First, you shouldn't be passing the password directly into this function (it should be hashed first). Second, it depends only on the length of the user supplied input (the second parameter). So the execution time will vary, but 100% based on user input. No information about the stored string is leaked... --------------------------------------------------------------------------- by apfelbox at 2012-12-29T14:09:54Z @ircmaxell yes, I just thought about it for a while and you are right. The `strlen($knownString)` is a constant factor and therefore the execution time of the function does not vary with it (especially if it is hashed).
0 commit comments