Vulnerabilities in pkg:npm/secure-compare

PACKAGE
Advisory Identifier: GHSA-h9x2-5rm7-x4gm
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/secure-compare

1 Known Advisory Record(s)

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

CVE Identifier CVE-2015-9238
GHSA Identifier GHSA-h9x2-5rm7-x4gm
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-697: Incorrect Comparison
Affected Product Secure compare
Package Ecosystem npm
Published Date
Last Updated

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.

secure-compare fixed: 3.0.1
npm install secure-compare@3.0.1
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 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

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. ## Recommendation Upgrade to version 3.0.1 or later.

CVE-2015-9238 Affected Secure compare Versions

1 component(s)
Fixed Versions:
3.0.1
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?
CVE-2015-9238 is a security vulnerability in Secure compare involving Insecure Comparison in secure-compare under CWE-697: Incorrect Comparison.
Which Secure compare versions are affected?
Affected versions include releases prior to 3.0.1 across affected packages: secure-compare.
What version fixes CVE-2015-9238?
Upgrading to 3.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is secure-compare affected?
Yes, secure-compare is affected in releases prior to 3.0.1. Upgrade your dependency to 3.0.1 or later.
What CWE is associated with CVE-2015-9238?
CVE-2015-9238 is classified under CWE-697: Incorrect Comparison (The product compares two entities in a security-relevant context, but the comparison is incorrect.).
How can I check npm dependencies for CVE-2015-9238?
Run the dependency tree command: 'npm ls secure-compare'. 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-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
  }
}