Vulnerabilities in pkg:npm/csrf-lite

PACKAGE
Advisory Identifier: GHSA-hjhr-r3gq-qvp6
Advisory Summary

CVE-2016-10535 is a HIGH timing attack vulnerability (CWE-208: Observable Timing Discrepancy) affecting Csrf lite libraries in the npm ecosystem. The issue involves timing attack in csrf-lite. Remediation is available by upgrading affected packages to version 0.1.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/csrf-lite

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/csrf-lite. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-hjhr-r3gq-qvp6 CVE-2016-10535 HIGH Timing Attack in csrf-lite

CVE-2016-10535 at a Glance

CVE Identifier CVE-2016-10535
GHSA Identifier GHSA-hjhr-r3gq-qvp6
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-208: Observable Timing Discrepancy
Affected Product Csrf lite
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2016-10535

To remediate this vulnerability, upgrade all affected Csrf lite dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

csrf-lite fixed: 0.1.2
npm install csrf-lite@0.1.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls csrf-lite

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2016-10535, inspect your project dependencies using npm:

npm ls csrf-lite

Analyze the terminal output to locate any version of Csrf lite in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.2), your application is affected.

Note: The npm ls csrf-lite command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-208: Observable Timing Discrepancy, where two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not. In Csrf lite, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Affected versions of `csrf-lite` are vulnerable to timing attacks as a result of testing CSRF tokens via a fail-early comparison instead of a constant-time comparison. Timing attacks remove the exponential increase in entropy gained from increased secret length, by providing per-character feedback on the correctness of a guess via miniscule timing differences. Under favorable network conditions, an attacker can exploit this to guess the secret in no more than (16*18)288 guesses, instead of the 16^18 guesses required were the timing attack not present. ## Recommendation Update to version 0.1.2 or later.

CVE-2016-10535 Affected Csrf lite Versions

1 component(s)
Fixed Versions:
0.1.2
Product / Package Ecosystem Affected Versions Fixed Version
csrf-lite
npm
< 0.1.2
0.1.2

References

Frequently Asked Questions

What is CVE-2016-10535?
CVE-2016-10535 is a security vulnerability in Csrf lite involving Timing Attack in csrf-lite under CWE-208: Observable Timing Discrepancy.
Which Csrf lite versions are affected?
Affected versions include releases prior to 0.1.2 across affected packages: csrf-lite.
What version fixes CVE-2016-10535?
Upgrading to 0.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is csrf-lite affected?
Yes, csrf-lite is affected in releases prior to 0.1.2. Upgrade your dependency to 0.1.2 or later.
What CWE is associated with CVE-2016-10535?
CVE-2016-10535 is classified under CWE-208: Observable Timing Discrepancy (Two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not.).
How can I check npm dependencies for CVE-2016-10535?
Run the dependency tree command: 'npm ls csrf-lite'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hjhr-r3gq-qvp6",
  "modified" : "2020-08-31T18:10:37Z",
  "published" : "2019-02-18T23:39:44Z",
  "aliases" : [ "CVE-2016-10535" ],
  "summary" : "Timing Attack in csrf-lite",
  "details" : "Affected versions of `csrf-lite` are vulnerable to timing attacks as a result of testing CSRF tokens via a fail-early comparison instead of a constant-time comparison. \n\nTiming attacks remove the exponential increase in entropy gained from increased secret length, by providing per-character feedback on the correctness of a guess via miniscule timing differences.\n\nUnder favorable network conditions, an attacker can exploit this to guess the secret in no more than (16*18)288 guesses, instead of the 16^18 guesses required were the timing attack not present. \n\n\n## Recommendation\n\nUpdate to version 0.1.2 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "csrf-lite"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-10535"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/isaacs/csrf-lite/pull/1"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-hjhr-r3gq-qvp6"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/94"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-208" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:40:36Z",
    "nvd_published_at" : null
  }
}