CVE-2016-1000236: cookie-signature Timing Attack

cookie-signature Updated 02 Oct 2025

Summary

06/01/2020
Yes i
Moderate
4.4

CVE-2016-1000236: cookie-signature Timing Attack. Affects cookie-signature versions < 1.0.4. Fixed in 1.0.4. How to fix ↓

Also tracked for

The same CVE-2016-1000236 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The cookie-signature package is an npm package used for signing and verifying cookies in web applications. It provides a mechanism to ensure the integrity and authenticity of cookies by adding a signature to them. The package is widely used in Node.js applications for session management and cookie-based authentication. However, versions prior to 1.0.4 are vulnerable to a timing attack.

Vulnerability Detail

The vulnerability in cookie-signature arises from the use of a fail-early comparison instead of a constant-time comparison. This makes it susceptible to timing attacks, where an attacker can exploit minuscule timing differences to guess the secret used for signing cookies. By providing per-character feedback on the correctness of a guess, an attacker can significantly reduce the number of guesses required to guess the secret. Under favorable network conditions, the attacker can guess the secret in no more than charset*length guesses, instead of charset^length guesses required without the timing attack. This vulnerability has a CVSS score of 4.4 (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N).

How To Fix

Minimum fixed version

1.0.4

This is the first release that contains the fix.

npm install cookie-signature@1.0.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Conclusion

The cookie-signature package prior to version 1.0.4 is vulnerable to a timing attack, which can allow an attacker to guess the secret used for signing cookies. To mitigate this vulnerability, it is recommended to update to version 1.0.4 or later. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for cookie-signature →

Share this vulnerability

FAQ

The vulnerability allows an attacker to guess the secret used for signing cookies in a significantly reduced number of guesses. This can lead to unauthorized access, session hijacking, and other security breaches.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities using just the package-lock.json file.

No, there are no known workarounds for this vulnerability. It is recommended to update to the fixed version of the cookie-signature package.

No, there is no known exploit code available for this vulnerability at the moment.

You can find more information about this vulnerability in the GitHub Advisory Database at https://github.com/github/advisory-database/advisories/GHSA-92vm-wfm5-mxvv.

How To Fix

Minimum fixed version

1.0.4

This is the first release that contains the fix.

npm install cookie-signature@1.0.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback