'cookie-signature' is a library for signing cookies.
1.0.4 of the library use the built-in string comparison mechanism,
===, and not a time constant string comparison. As a result, the comparison will fail faster when the first characters in the token are incorrect.
An attacker can use this difference to perform a timing attack, essentially allowing them to guess the secret one character at a time.
You can read more about timing attacks in Node.js on the Snyk blog: https://snyk.io/blog/node-js-timing-attack-ccc-ctf/
1.0.4 or greater.
- Snyk ID
- 28 Jan, 2014
- 29 Aug, 2016