GHSA-h6ch-v84p-w6p9: Diff Denial of Service Vulnerability
HIGHGHSA-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
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.
npm install diff@3.5.0
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
GHSA-h6ch-v84p-w6p9 Affected Diff Versions
1 component(s)| 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?
Which Diff versions are affected?
What version fixes GHSA-h6ch-v84p-w6p9?
Is diff affected?
What CWE is associated with GHSA-h6ch-v84p-w6p9?
How can I check npm dependencies for GHSA-h6ch-v84p-w6p9?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}