# GHSA-v2p6-4mp7-3r9v: Regular Expression Denial of Service in underscore.string

> An attacker can cause a denial of service in applications using underscore.string by submitting specially crafted input to the unescapeHTML function.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Jun 2019

## What is GHSA-v2p6-4mp7-3r9v?

GHSA-v2p6-4mp7-3r9v is a denial of service vulnerability in underscore.string, published on 14 Jun 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

## Which versions are affected by GHSA-v2p6-4mp7-3r9v?

2 open source packages ship an affected version, including underscore.string.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `underscore.string` | npm | All versions | 3.3.5 |
| `underscore.string` | npm | All versions | 3.3.5 |

## How do I fix GHSA-v2p6-4mp7-3r9v?

Upgrade underscore.string to 3.3.5 or later.

## Is GHSA-v2p6-4mp7-3r9v being exploited?

There is no known exploitation of GHSA-v2p6-4mp7-3r9v in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-v2p6-4mp7-3r9v and fix it if it is affected.

What it is: GHSA-v2p6-4mp7-3r9v is a denial of service vulnerability in underscore.string, published on 14 Jun 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-v2p6-4mp7-3r9v in the wild and no public exploit code.

Affected packages and fixed versions:
- underscore.string (npm): affected all versions; fixed in 3.3.5
- underscore.string (npm): affected all versions; fixed in 3.3.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-v2p6-4mp7-3r9v/ (Markdown: https://insights.sbomify.com/GHSA-v2p6-4mp7-3r9v/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-v2p6-4mp7-3r9v

---
From sbomify Insights: https://insights.sbomify.com/GHSA-v2p6-4mp7-3r9v/
Summaries are generated and may contain mistakes; the official description above is the record.
