-
Notifications
You must be signed in to change notification settings - Fork 35
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 crypto.timingSafeEqual for unsign #24
Conversation
Thanks, this will be great! There's just a few things that stand out:
|
aa1bcc9
to
68b9205
Compare
@natevw Done! |
@jodevsa Nearly there, thank you! I was about to merge it but then realized a potential issue. I like the trick for making the buffers equal size, but instead of the deprecated Otherwise I think it's solid:
Starting with a zero-filled |
@natevw Thanks a lot for your valuable explanations, I've learned so many things from you and the project ! |
Merged, and published as Thanks for making this happen! It's good to have this in place since the earlier method had led to a lot of confusion. |
Just came across this PR trying to upgrade |
@dougwilson , |
Thanks @jodevsa . Is there any way to get a version of this module that is compatible with Node.js LTS (4.x)? |
The reason I'm asking is because I'm being told that this PR is a security fix and so I'm trying to get Express and such upgraded to the 1.1.0 version of this module, but without even 4.x support this is going to be a real mess for everyone trying to get the security update. If it's at all possible to backport the security fix that would be super appreciated :) ! |
@dougwilson Version 1.1.0 is not a security fix. Since version 1.0.4 this library has used a timing safe comparison strategy. We used a second hash step to do so. (See #14,#17) The "extra" hashing led to lots of confusion/discussion over the years (#15 #19 #20 #21 #23) and recently started causing warnings — which were not really of true concern due to the nature of our use — in some audit tools (#22). So we finally made the move to the more readable |
Hi @natevw I'm sorry for the confusion. I was working off of a security vulnerability report disclosed to the Express project in good faith. The user agrees now that it is not a security issue. He also told me how he came to the conclusion that 1.1.0 was a security release and it came down to the fact the commit 5fb33f0 visible in the commit history is titled "Use timingSafeEqual instead of hashing to prevent time attack" which made it sound like the commit is necessary to prevent a timing attack. |
@dougwilson Ah, yes. The committer must have meant that as "switch from the old hashing trick to now-builtin timingSafeEqual, in the logic that prevents timing attacks". But I can see how that would be confusing! |
No description provided.