GHSA-v2p6-4mp7-3r9v: Underscore.string Denial of Service Vulnerability

MODERATE
CWE-400
Published
Advisory Summary

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

GHSA-v2p6-4mp7-3r9v at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-v2p6-4mp7-3r9v
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Underscore.string
Package Ecosystem npm
Published Date
Last Updated

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.

underscore.string fixed: 3.3.5
npm install underscore.string@3.3.5
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 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

Versions of `underscore.string` prior to *3.3.5* are vulnerable to Regular Expression Denial of Service (ReDoS). The 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. ## Recommendation Upgrade to version 3.3.5 or higher.

GHSA-v2p6-4mp7-3r9v Affected Underscore.string Versions

1 component(s)
Fixed Versions:
3.3.5
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?
GHSA-v2p6-4mp7-3r9v is a security vulnerability in Underscore.string involving Regular Expression Denial of Service in underscore.string under CWE-400: Uncontrolled Resource Consumption.
Which Underscore.string versions are affected?
Affected versions include releases prior to 3.3.5 across affected packages: underscore.string.
What version fixes GHSA-v2p6-4mp7-3r9v?
Upgrading to 3.3.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is underscore.string affected?
Yes, underscore.string is affected in releases prior to 3.3.5. Upgrade your dependency to 3.3.5 or later.
What CWE is associated with GHSA-v2p6-4mp7-3r9v?
GHSA-v2p6-4mp7-3r9v 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-v2p6-4mp7-3r9v?
Run the dependency tree command: 'npm ls underscore.string'. 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-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
  }
}