Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. csrf-lite
  4. ›
  5. GMS-2016-30

GMS-2016-30: Non-Constant Time String Comparison

April 23, 2016

csrf-lite uses ===, a fail first string comparison, instead of a time constant string comparison. This enables an attacker being able to calculate minuscule differences in CSRF tokens, essentially enabling them to guess the token one character at a time Each check increases the variable tempCheck by one. If a malicious user is able to see what tempCheck is at each run (how long it takes to do a check), then they can see when it increases. This increase indicates that the character they just put in for csrfTokenCompare is the correct one.

References

  • github.com/isaacs/csrf-lite/pull/1

Code Behaviors & Features

Detect and mitigate GMS-2016-30 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions up to 0.1.1

Fixed versions

  • 0.1.2

Solution

Update to at least version 0.1.2

Source file

npm/csrf-lite/GMS-2016-30.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:17:15 +0000.