Vulnerabilities in pkg:npm/underscore.string
PACKAGEGHSA-v2p6-4mp7-3r9v is a MODERATE denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Underscore.string libraries in the npm ecosystem. The issue involves regular expression denial of service in underscore.string. Remediation is available by upgrading affected packages to version 3.3.5.
pkg:npm/underscore.string
Vulnerability advisories affecting package pkg:npm/underscore.string. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-v2p6-4mp7-3r9v | - | MODERATE | Regular Expression Denial of Service in underscore.string |
GHSA-v2p6-4mp7-3r9v at a Glance
How to Fix GHSA-v2p6-4mp7-3r9v
To remediate this vulnerability, upgrade all affected Underscore.string 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 underscore.string@3.3.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls underscore.string
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-v2p6-4mp7-3r9v, inspect your project dependencies using npm:
npm ls underscore.string
Analyze the terminal output to locate any version of Underscore.string in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.5), your application is affected.
Note: The npm ls underscore.string 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 Underscore.string, 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-v2p6-4mp7-3r9v Affected Underscore.string Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
underscore.string
|
npm |
< 3.3.5
|
3.3.5
|
References
Frequently Asked Questions
What is GHSA-v2p6-4mp7-3r9v?
Which Underscore.string versions are affected?
What version fixes GHSA-v2p6-4mp7-3r9v?
Is underscore.string affected?
What CWE is associated with GHSA-v2p6-4mp7-3r9v?
How can I check npm dependencies for GHSA-v2p6-4mp7-3r9v?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v2p6-4mp7-3r9v",
"modified" : "2020-08-31T18:34:16Z",
"published" : "2019-06-14T16:26:22Z",
"aliases" : [ ],
"summary" : "Regular Expression Denial of Service in underscore.string",
"details" : "Versions of `underscore.string` prior to *3.3.5* are vulnerable to Regular Expression Denial of Service (ReDoS).\n\nThe function `unescapeHTML` is vulnerable to ReDoS due to an overly-broad regex. The slowdown is approximately 2s for 50,000 characters but grows exponentially with larger inputs.\n\n\n## Recommendation\n\nUpgrade to version 3.3.5 or higher.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "underscore.string"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.3.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/epeli/underscore.string/issues/510"
}, {
"type" : "WEB",
"url" : "https://github.com/epeli/underscore.string/pull/517"
}, {
"type" : "WEB",
"url" : "https://github.com/epeli/underscore.string/commit/f486cd684c94c12db48b45d52b1472a1b9661029"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/745"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2019-06-14T16:24:01Z",
"nvd_published_at" : null
}
}