GHSA-c35v-qwqg-87jc: Express basic auth Express-basic-auth Timing Attack Due To Vulnerability

LOW
CVSS 3.1
CWE-208
Published
Advisory Summary

GHSA-c35v-qwqg-87jc is a LOW (CVSS 3.1) express-basic-auth timing attack due to vulnerability (CWE-208: Observable Timing Discrepancy) affecting Express basic auth libraries in the npm ecosystem. The issue involves express-basic-auth timing attack due to native string comparison instead of constant time string comparison. Remediation is available by upgrading affected packages to version 1.1.7.

GHSA-c35v-qwqg-87jc at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-c35v-qwqg-87jc
Severity LOW
CVSS v3.1 Base Score 3.1
CWE Classification CWE-208: Observable Timing Discrepancy
Affected Product Express basic auth
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Adjacent (AV:A)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-c35v-qwqg-87jc

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

express-basic-auth fixed: 1.1.7
npm install express-basic-auth@1.1.7
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 express-basic-auth

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-c35v-qwqg-87jc, inspect your project dependencies using npm:

npm ls express-basic-auth

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

Note: The npm ls express-basic-auth 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 Express basic auth, 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

Versions of `express-basic-auth` prior to 1.1.7 are vulnerable to Timing Attacks. The package uses native string comparison instead of a constant time string comparison, which may lead to Timing Attacks. Timing Attacks can be used to increase the efficiency of brute-force attacks by removing the exponential increase in entropy gained from longer secrets. ## Recommendation Upgrade to version 1.1.7 or later.

GHSA-c35v-qwqg-87jc Affected Express basic auth Versions

1 component(s)
Fixed Versions:
1.1.7
Product / Package Ecosystem Affected Versions Fixed Version
express-basic-auth
npm
< 1.1.7
1.1.7

References

Frequently Asked Questions

What is GHSA-c35v-qwqg-87jc?
GHSA-c35v-qwqg-87jc is a security vulnerability in Express basic auth involving express-basic-auth Timing Attack due to native string comparison instead of constant time string comparison under CWE-208: Observable Timing Discrepancy.
Which Express basic auth versions are affected?
Affected versions include releases prior to 1.1.7 across affected packages: express-basic-auth.
What version fixes GHSA-c35v-qwqg-87jc?
Upgrading to 1.1.7 (or the latest patched release for your respective branch) resolves the vulnerability.
Is express-basic-auth affected?
Yes, express-basic-auth is affected in releases prior to 1.1.7. Upgrade your dependency to 1.1.7 or later.
What is the CVSS score of GHSA-c35v-qwqg-87jc?
GHSA-c35v-qwqg-87jc has a CVSS v3.1 base score of 3.1 (LOW) with vector string CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with GHSA-c35v-qwqg-87jc?
GHSA-c35v-qwqg-87jc 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 GHSA-c35v-qwqg-87jc?
Run the dependency tree command: 'npm ls express-basic-auth'. 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-c35v-qwqg-87jc",
  "modified" : "2022-08-03T16:27:53Z",
  "published" : "2019-06-06T15:32:32Z",
  "aliases" : [ ],
  "summary" : "express-basic-auth Timing Attack due to native string comparison instead of constant time string comparison",
  "details" : "Versions of `express-basic-auth` prior to 1.1.7 are vulnerable to Timing Attacks. The package uses native string comparison instead of a constant time string comparison, which may lead to Timing Attacks. Timing Attacks can be used to increase the efficiency of brute-force attacks by removing the exponential increase in entropy gained from longer secrets.\n\n\n## Recommendation\n\nUpgrade to version 1.1.7 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "express-basic-auth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.7"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/webpack-contrib/webpack-bundle-analyzer/issues/263"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/LionC/express-basic-auth/pull/20"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/LionC/express-basic-auth/pull/21"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/LionC/express-basic-auth/commit/00bb29fdd638f5cda8025d4398be97d528ce3f6f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/LionC/express-basic-auth"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-EXPRESSBASICAUTH-174345"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/827"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-208" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-06-06T09:51:04Z",
    "nvd_published_at" : null
  }
}