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

Added time constant string comparison #1

Merged

Conversation

twolfson
Copy link
Contributor

@twolfson twolfson commented Feb 3, 2016

The string comparison currently used in csrf-lite is susceptible to a timing attack (e.g. attacker can detect millisecond changes by Node.js short circuiting string comparison). To mitigate that attack, we can use a time constant string comparison.

In this PR:

  • Moved from === to scmp for time constant string comparison

@twolfson
Copy link
Contributor Author

twolfson commented Feb 3, 2016

Retrospectively, this should have been reported to Node Security Project first. We have done it as an after thought but sorry for the immediate public disclosure =(

@isaacs isaacs merged commit e6dadd0 into isaacs:master Mar 29, 2016
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

Successfully merging this pull request may close these issues.

2 participants