GHSA-h6ch-v84p-w6p9: Diff Denial of Service Vulnerability

HIGH
CWE-400
Published
Advisory Summary

GHSA-h6ch-v84p-w6p9 is a HIGH denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Diff libraries in the npm ecosystem. The issue involves regular expression denial of service (redos). Remediation is available by upgrading affected packages to version 3.5.0.

GHSA-h6ch-v84p-w6p9 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-h6ch-v84p-w6p9
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Diff
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-h6ch-v84p-w6p9

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

diff fixed: 3.5.0
npm install diff@3.5.0
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 diff

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-h6ch-v84p-w6p9, inspect your project dependencies using npm:

npm ls diff

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

Note: The npm ls diff 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Diff, 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

A vulnerability was found in diff before v3.5.0, the affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks.

GHSA-h6ch-v84p-w6p9 Affected Diff Versions

1 component(s)
Fixed Versions:
3.5.0
Product / Package Ecosystem Affected Versions Fixed Version
diff
npm
< 3.5.0
3.5.0

References

Frequently Asked Questions

What is GHSA-h6ch-v84p-w6p9?
GHSA-h6ch-v84p-w6p9 is a security vulnerability in Diff involving Regular Expression Denial of Service (ReDoS) under CWE-400: Uncontrolled Resource Consumption.
Which Diff versions are affected?
Affected versions include releases prior to 3.5.0 across affected packages: diff.
What version fixes GHSA-h6ch-v84p-w6p9?
Upgrading to 3.5.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is diff affected?
Yes, diff is affected in releases prior to 3.5.0. Upgrade your dependency to 3.5.0 or later.
What CWE is associated with GHSA-h6ch-v84p-w6p9?
GHSA-h6ch-v84p-w6p9 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for GHSA-h6ch-v84p-w6p9?
Run the dependency tree command: 'npm ls diff'. 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-h6ch-v84p-w6p9",
  "modified" : "2021-02-24T19:27:02Z",
  "published" : "2019-06-13T18:58:54Z",
  "aliases" : [ ],
  "summary" : "Regular Expression Denial of Service (ReDoS)",
  "details" : "A vulnerability was found in diff before v3.5.0, the affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "diff"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.5.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kpdecker/jsdiff/commit/2aec4298639bf30fb88a00b356bf404d3551b8c0"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1552148"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/npm:diff:20180305"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1631"
  }, {
    "type" : "WEB",
    "url" : "https://www.whitesourcesoftware.com/vulnerability-database/WS-2018-0590"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-06-13T18:54:38Z",
    "nvd_published_at" : null
  }
}