Vulnerabilities in pkg:npm/secure-compare
PACKAGECVE-2015-9238 is a HIGH insecure comparison vulnerability (CWE-697: Incorrect Comparison) affecting Secure compare libraries in the npm ecosystem. The issue involves insecure comparison in secure-compare. Remediation is available by upgrading affected packages to version 3.0.1.
pkg:npm/secure-compare
Vulnerability advisories affecting package pkg:npm/secure-compare. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-h9x2-5rm7-x4gm | CVE-2015-9238 | HIGH | Insecure Comparison in secure-compare |
CVE-2015-9238 at a Glance
How to Fix CVE-2015-9238
To remediate this vulnerability, upgrade all affected Secure compare 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 secure-compare@3.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls secure-compare
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2015-9238, inspect your project dependencies using npm:
npm ls secure-compare
Analyze the terminal output to locate any version of Secure compare in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.1), your application is affected.
Note: The npm ls secure-compare 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-697: Incorrect Comparison, where the product compares two entities in a security-relevant context, but the comparison is incorrect. In Secure compare, 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
CVE-2015-9238 Affected Secure compare Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
secure-compare
|
npm |
< 3.0.1
|
3.0.1
|
References
Frequently Asked Questions
What is CVE-2015-9238?
Which Secure compare versions are affected?
What version fixes CVE-2015-9238?
Is secure-compare affected?
What CWE is associated with CVE-2015-9238?
How can I check npm dependencies for CVE-2015-9238?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h9x2-5rm7-x4gm",
"modified" : "2020-08-31T18:09:18Z",
"published" : "2019-06-03T17:28:23Z",
"aliases" : [ "CVE-2015-9238" ],
"summary" : "Insecure Comparison in secure-compare",
"details" : "Versions of `secure-compare` prior to 3.0.1 are affected by a vulnerability that results in the package always returning true when comparing two strings of the same length, despite differences in the contents of those strings.\n\n\n## Recommendation\n\nUpgrade to version 3.0.1 or later.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "secure-compare"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-9238"
}, {
"type" : "WEB",
"url" : "https://github.com/vdemedes/secure-compare/pull/1"
}, {
"type" : "WEB",
"url" : "https://github.com/vadimdemedes/secure-compare/commit/dd1ff1ac0122de7e0af4f00c61ed73261062394a"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/50"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-697" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2019-06-03T17:22:37Z",
"nvd_published_at" : null
}
}