Skip to content
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 SHA1 to create filestores #11

Open
karthik-rangarajan opened this issue Dec 19, 2013 · 1 comment
Open

Use SHA1 to create filestores #11

karthik-rangarajan opened this issue Dec 19, 2013 · 1 comment

Comments

@karthik-rangarajan
Copy link

In line 92,

var fileName = this.prefix + crypto.createHash('md5').update(sid).digest('hex');

md5 is used to create a hash that can be appended to the file store. However, md5 has been proved to be broken, and it is entirely possible that multiple keys existed that would result in the same md5 hash. For applications that are using unsigned cookies, this could potentially be a problem. The simplest solution is to replace the md5 with sha1.

@gabegorelick
Copy link

+1 Although in practice, the vast majority of cookies will be signed. E.g express-session and its predecessor connect-session really force you to set a secret to use for signing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants