GHSA-c35v-qwqg-87jc: Express basic auth Express-basic-auth Timing Attack Due To Vulnerability
LOWGHSA-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
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).
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.
npm install express-basic-auth@1.1.7
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
GHSA-c35v-qwqg-87jc Affected Express basic auth Versions
1 component(s)| 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?
Which Express basic auth versions are affected?
What version fixes GHSA-c35v-qwqg-87jc?
Is express-basic-auth affected?
What is the CVSS score of GHSA-c35v-qwqg-87jc?
What CWE is associated with GHSA-c35v-qwqg-87jc?
How can I check npm dependencies for GHSA-c35v-qwqg-87jc?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}