Junglewise Threat Intelligence

CVE-2016-10535: csrf-lite timing attack in CSRF token validation

CVE-2016-10535 · Severity: info · Published 2019-02-18

Vendors: npm.

Executive brief

csrf-lite is a Node.js library used to protect web applications against cross-site request forgery (CSRF) attacks. Due to improper token comparison logic, attackers can exploit timing differences to incrementally guess valid CSRF tokens, reducing the cryptographic strength of the protection significantly. This undermines the security of web applications that rely on this library for CSRF defense.

Technical details

The vulnerability is a timing attack (CWE-208) in csrf-lite's CSRF token validation mechanism. The library uses a fail-fast (non-constant-time) comparison function to verify CSRF tokens instead of a constant-time comparison. This allows an attacker to receive measurable timing feedback on each character of the token, reducing the entropy gain from token length. Under favorable network conditions, an attacker can guess a 18-character hexadecimal token in approximately 288 guesses rather than 16^18 guesses. The vulnerability affects all versions prior to 0.1.2. No evidence of active exploitation in the wild has been reported, but the fix is available and should be applied by updating to version 0.1.2 or later.

Affected products

  • Isaac Z. Schlueter csrf-lite before 0.1.2

Timeline

  • 2019-02-18: disclosed

References